• Home
  • 0.0.0.0/0
    • FreeBSD on Ubiquiti EdgeRouter Pro 8
    • FreeBSD Build Items
  • **void
    • Data Organization Functions
    • IPv4 Functions
    • Solarwinds SWQL Examples
  • InfoCEF
    • crunch-bang
    • TCL QuickSheet
    • Configlets
      • Internet Ingress Transit Access-List
  • About

protocolSyntax

~ We put the 'P' in the Internet

protocolSyntax

Author Archives: C. M. Stephan

Negative Overflow of 4-byte AS in Solarwinds Orion Output

27 Monday Mar 2017

Posted by C. M. Stephan in Application, Bug / Known Problem, CodeProject, Development, RootAdmin, TCP/IP

≈ 2 Comments

4-byte (32-bit) BGP Neighbor Information with AsDotNotation

A problem currently exists within Solarwinds where 4-byte (32-bit) ASNs overflow into a negative number when utilizing a portion of the private scoped ASN space specifically, the ranges 2,147,483,648 (32768.0) through 4,294,967,296 (65535.65535) overflow into -2,147,483,648 through -1 respectively.

To show the correct data, we created a custom table utilizing the following WSQL to generate the correct information. See past the snippet for an explanation as to how and why this works.

Continue reading →

Advertisement

Linux/UNIX Pipes File Descriptors, and Process Substitution

18 Tuesday Oct 2016

Posted by C. M. Stephan in Uncategorized

≈ Leave a comment

Linux/UNIX Pipes File Descriptors, and Process Substitution

  • POSIX Shell – A logical container providing an environment and a set of commands to interact with a UNIX and/or UNIX-like system.
    Examples include: sh(Bourne shell), bash, ash, csh, etc.
  • Pipe – a unidirectional connection between two processes utilized for inter-process communications.
  • File Descriptor (fd) – A dynamically created, locally significant and non-persistent file representation of a FIFO buffer which can be connected to a pipe, or by default to the parent process’ standard input, output, and error buffers. As an example, a (virtual) terminal’s input device (keyboard, mouse, etc.) and output device (display).
  • Process substitution – Allows the POSIX shell user the ability create scripted constructs that mimic functional and/or imperative programming syntax in-line.

Every interactive process on startup within a POSIX shell is attached dynamically to three pipes local to its memory space. Standard Input(0), Standard Output(1), and Standard Error(2). If the POSIX system supports file descriptors they are then created and attached to the pipes at ‘/dev/fd/’.

Name Abbrev. File Symbols
standard input stdin /dev/fd/0 < or <<
standard output stdout /dev/fd/1 1> or 1>>
standard error stderr /dev/fd/2 2> or 2>>

POSIX Shell Plumbing

The POSIX (Bourne) shell and its derivatives provides the ability to utilize various symbols to plumb processes together by their file descriptors.

Symbol Name _Symbol_Syntax_ ________Function________
pipe { block } | { block } attach stdout of left script block
to  stdin of right script block
success
exec
cmd && { block } if cmd exits with success (0)
then execute block
failure
exec
cmd || { block } if cmd exits with error (not 0)
then execute block
write
file
{ block } #>file attach /dev/fd/#
of left script block to file
and overwrite with bytestream
write
fd
{ block } #>&? attach /dev/fd/#
of left script block to /dev/fd/?
and overwrite with bytestream
append { block } #>>file attach /dev/fd/#
of left script block to file
and append bytestream
close
stdout
#>&- close /dev/fd/#
(no # specified defaults to stdout)
read
file
{ block } <file attach stdin of left script block
to file and read bytestream
read
until
{ block } <&? attach stdin of left script block
to /dev/fd/? and read bytstream
read
until
{ block } <<word attach stdin of left script block
to stdin of proc
and read until word
close stdin <&- close stdin

Process Substitution

The POSIX shell also provides the ability to perform inline substitution utilizing two methods:

_Symbol_
Name
Symbol_Syntax ________Function________
sub-shell exec ( block ) execute process proc without environment persistance
sub-block exec { block; } execute proc resulting inline at location within script with evnironment persistance

…for examples see below

Continue reading →

INMARSAT BGAN Service Automation

28 Thursday Jan 2016

Posted by C. M. Stephan in BGAN, Control, Messaging, and Testing, Dynamic Multipoint Virtual Private Network (DMVPN), RootAdmin, Serial Tunneling (STUN), TCL, Telnet, Uncategorized

≈ 2 Comments

Tags

Hughes 9502

We are currently working on a project to implement DMVPN (IWAN) over BGAN. This is the process I went through to discover how to send AT commands from our Cisco IOS Router to the BGAN unit.

Continue reading →

Named Pipes with Putty and Tftp32 Syslog

17 Monday Aug 2015

Posted by C. M. Stephan in Internet Services, Protocol, RootAdmin

≈ Leave a comment

Tags

pipe, PuTTY, SYSLOG, tftpd32

Tftp32:

  • Enable Syslog in Global tab of Admin Panel
  • Enable Forward msg to pipe Tftpd32Syslog on the SYSLOG tab.

Windows Powershell command to view created Named Pipes:

[System.IO.Directory]::GetFiles("\\.\pipe\")

In PuTTY:

  • Select Serial, 9600, and for the port specify: \\.\pipe\Tftpd32Syslog
  • Connect.

Using TCL to provide WoL Services from a Cisco Router

29 Wednesday Jul 2015

Posted by C. M. Stephan in Cisco, CodeProject, Networking, TCL

≈ 5 Comments

This exceptional bit of code provided by Jónatan Þór Jónasson is a masterpiece. It provides the ability to send Wake On Lan commands out the local interfaces of a router to WakeUp a device. You will need a device that supports UDP Sockets, so you have to be running 15.0+ firmware.

Found this at ipSpace by Ivan Pepelnjak

ROUTER# tclsh
ROUTER(tclsh)#

proc WakeOnLan {broadcastAddr macAddr} {
     set net [binary format H* [join [split $macAddr -:] ""]]
     set pkt [binary format c* {0xff 0xff 0xff 0xff 0xff 0xff}]

     for {set i 0} {$i < 16} {incr i} {
        append pkt $net
     }

     # Open UDP and Send the Magic Paket.
     set udpSock [udp_open]
     fconfigure $udpSock -translation binary \
          -remote [list $broadcastAddr 4580] \
          -broadcast 1
     puts $udpSock $pkt
     flush $udpSock;
     close $udpSock
}

ROUTER(tclsh)# WakeOnLan 255.255.255.255 000f13cd80a1

Rolling a Domain Password

31 Tuesday Mar 2015

Posted by C. M. Stephan in CodeProject, Security, Shell Scripting

≈ Leave a comment

So I get extremely frustrated having to change my password every 60 days because the security department has this belief that somehow that is going to prevent the nightmare at Sony from coming down upon our company. Without getting too deep into the politics around security I am a firm believer that it is far better for people to have a password that is highly complex and never changes or better yet high entropy and very simple to remember as opposed to forced rotations of passwords. My reasoning is simple. If I were a hacker and I got your password, I wouldn’t wait 60 days to use it. I would own you in the immediate… as in right now.  Continue reading →

Cisco Telepresence Content Server: Windows Media Services Multicast and QoS

06 Thursday Feb 2014

Posted by C. M. Stephan in RootAdmin

≈ 1 Comment

Tags

Cisco, QoS, Telepresence, Windows Media Services

So we have been working diligently to resolve an issue in relation to a vendor deployed Cisco Telepresence Show and Share setup. We ended up with through the troubleshooting process with two requirements. Basically what we were seeing was if the access port attached to the receiver was configured or negotiated at 100Mbps as opposed to Gigabit that the video stream would not play with any measure of predictability.

When everyone would go home or be out for lunch, the stream would play okay, but when the switch became even slightly busy, the video would most of the time not even provide a single key-frame and hence no video. Keep in mind that this was a 768kbps stream, so it was insane to think this could actually be the switch causing the issue.

With Auto-QoS defaults, we were dropping around 500 packets in 10 seconds. We actually forced this work by modifying marking the multicast traffic generated at the server on the server’s access switch and by modifying the output buffers for QoS on the client attached 2960S Access Switch. This required giving 70% of the buffer to the priority Queue, making sure CS5 marked traffic was getting inserted into the Priority Queue, and setting the thresholds for the priority queue to allow oversubsciption at 3200%.

Continue reading →

Followup: DNS Lookup and Ping in Excel

17 Friday Jan 2014

Posted by C. M. Stephan in CodeProject, RootAdmin, VB

≈ 42 Comments

Steve asked on my previous posting in regards to DNS Lookup in Excel if forward lookup could be done. (Find the IP Address from the Hostname). Believe it or not I one up your request. How about DNS Forward and Reverse lookup as well as Ping!

  1. Press Alt-F11 in Excel to get to the VBA screen.
  2. Right click on the Project View
  3. Click Add Module
  4. Add the following snippet.
  5. Use: GetHostname("4.2.2.1") in any Excel cell.
    or
    Use:
    GetIpAddress("www.google.com") in any Excel cell.
    or
    Use: Ping("4.2.2.1") in any Excel cell.

Continue reading →

DS3/T3 Circuit Testing from the IOS Controller CLI

29 Saturday Jun 2013

Posted by C. M. Stephan in Uncategorized

≈ Leave a comment

Bert Testing

loopback local

Puts the locally attached DSU (Internal to the Router) in Loop. This allows the testing of the local Card for errors with the line driver or modulator

loopback remote

Requests a loopback from the remote DSU. This allows the testing of the full circuit up to the DSU at the far end.

loopback network

Sets the local controller to loop towards the network allowing the far end to run test patterns across the entire path.

Testing Examples:

controller t3 1/0 !-- test the local hardware
 loopback local
 !
 bert pattern 0s interval 1
 do show controller t1 0/0
 !
 bert pattern 1s interval 1
 do show controller t1 0/0
 !
 bert pattern alt-0-1 interval 1
 do show controller t1 0/0
 !
 no loopback

controller t3 1/0 !-- test to the remote DSU.
 loopback remote
 bert pattern 0s interval 1
 do show controller t3 1/0
 !
 bert pattern 1s interval 1
 do show controller t3 1/0
 !
 bert pattern alt-0-1 interval 1
 do show controller t3 1/0
 !
 no loopback

controller t3 1/0 !-- allow the far end to perform end-to-end testing.
 loopback network
 !
 !-- WAIT FOR TESTING AT FAR END TO COMPLETE..
 !
 no loopback
!
end

Circuit Locating

You can transmit endpoint location information across a circuit using the ANSI Maintenance Description Set. The following example shows how this is specified:

Circuit Labeling Example:

controller t3 1/0 !-- Identification notation transmited via ANSI MDL Frames
 mdl string eic RouterA     !-- Equiptment ID Code
 mdl string fic 0x01        !-- Frame ID Code
 mdl string generator gen-1 !-- Generator Number in MDL Test Signal Message
 mdl string lic OKC         !-- Location ID Code
 mdl string pfi DT          !-- Facility ID Code
 mdl string port 1-0        !-- Port Number in MDL Idle Signal Message
 mdl string unit 2          !-- Unit Code
 !
 mdl transmit test-signal
!
end

Viewing example at far end of circuit:

show controllers t3 1/0

Results:
T3 1/0 is up.
  Applique type is Subrate T3
  Transmitter is sending AIS.
  Receiver has no alarms.
  MDL transmission is enabled
     EIC: Router-B, LIC: TUL, FIC: FO, UNIT: 1
  Far-End MDL Information Received
     EIC: Router-A, LIC: OKC, FIC: DT, UNIT: 1
  FEAC code received: No code is being received
  Framing is C-BIT Parity, Line Code is B3ZS, Clock Source is Line
  Data in current interval (30 seconds elapsed):
     0 Line Code Violations, 0 P-bit Coding Violation
     0 C-bit Coding Violation, 0 P-bit Err Secs
     0 P-bit Severely Err Secs, 0 Severely Err Framing Secs
     0 Unavailable Secs, 0 Line Errored Secs
     0 C-bit Errored Secs, 0 C-bit Severely Errored Secs
!
end

DNS Reverse Lookup in Excel

04 Tuesday Dec 2012

Posted by C. M. Stephan in Uncategorized

≈ 11 Comments

I’m always looking for this, so I figure here is as good as any for safe keeping.. It’s simple to use…

  1. Press Alt-F11 in Excel to get to the VBA screen.
  2. Right click on the Project View
  3. Click Add Module
  4. Add the following snippet.
  5. Use: GetHostname("4.2.2.1") in any Excel cell.

Continue reading →

← Older posts
Newer posts →

Find:

Categories

Application BGAN Bug / Known Problem Cisco CodeProject Control, Messaging, and Testing Development Dynamic Multipoint Virtual Private Network (DMVPN) Internet Services Networking Protocol RootAdmin Routing Security Serial Tunneling (STUN) Shell Scripting System Control and Data Aquisition (SCADA) TCL TCP/IP Telnet Transport Control Protocol (TCP) Uncategorized VB Virtualization Web World Wide Web

Tags

Automation business CIP Cisco Domain Name google Hughes 9502 IACS internet ISA-99 keywords marketing meta NERC NERCCIP nofollow pipe Programming PuTTY QoS realist approach SCADA Search Engine Optimization Security Seeding SEO shadow site short url StuxNet SYSLOG TCP technology Telepresence tftpd32 Timeout TinyUrl Web Windows Media Services Winsock

Create a free website or blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • protocolSyntax
    • Already have a WordPress.com account? Log in now.
    • protocolSyntax
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar