10-27-2017 08:28 AM - edited 03-08-2019 12:31 PM
Hi all!
I have created seral port extender over IP based on Cisco 28xx routers and HWIC-1T + CAB-SS-232FC/MT cables pair.
Here is a picture of my network setup
BSTUN protocol is used in asynchronous mode (yes, I need async). I took this Cisco's sample https://www.cisco.com/c/en/us/support/docs/ip/serial-tunnel-stun/41983-bstun-41983.html and applied to my routers. Both routers in the same LAN, connected to the same unmanaged switch. Each interface can ping each other. So, no any IP connectivity/latency/packet loss problems at all.
My config part related to this "extender" looks like this:
bstun peer-name 192.168.168.145 bstun protocol-group 103 async-generic ! interface loopback1 ip address 192.168.168.145 255.255.255.255 ! interface serial 0/2/0 physical-layer async encapsulation bstun asp role secondary bstun group 103 bstun route all tcp 192.168.168.146 ! line34 modem DTR-active speed 9600 |
bstun peer-name 192.168.168.146 bstun protocol-group 103 async-generic ! interface loopback1 ip address 192.168.168.146 255.255.255.255 ! interface serial 0/2/0 physical-layer async encapsulation bstun asp role primary bstun group 103 bstun route all tcp 192.168.168.145 ! line34 modem DTR-active speed 9600 < routing part omitted > |
I got working terminal to terminal "messaging" at 9600 bps, and one of serial apps works well too. But most of serial applications (which are 9600 async too!) fails via this serial "extender". I tried many apps, that works absolutely stable on real COM ports and tried many, 5 as minimum. And they are all fails - they try to communicate, send some data, but finally shows timeout, error or doesn't do what expected on the remote side.
I started investigating in direction of commands used to configure such kind lf lines. I read a lot about serial troubleshooting. And I've tried to issue every found command step by step (with checking result after each command issue). But no luck. Here is a list of commands I've applied to ascyn line 34 (s0/2/0):
speed 9600 stopbits 1 databits 8 flowcontrol none | software | hardware parity none no motd-banner no exec-banner no vacant-message exec-timeout 0 0 no flush-at-activation special-character-bits 8 transport input all transport output all escape-character none | break | default modem inout exec | no exec no activation-character session-timeout 0
No luck.
After that I started doing serial port sniffing (by using MS PORTMON) to find dfferencies in data exchange via local COM port and network COM port. And I found a reason in a second! Because all of IRP_MJ_READ request has TIMEOUT status instead of SUCCESS (when local serial port used). And also request length is zero (no data) instead of useful data. Here are portions of PORTMON logs from different setups:
Cisco serial extension |
Local com port |
19 0.00003131 IRP_MJ_WRITE Serial0 SUCCESS Length 1: F0 20 0.00000411 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 21 0.04243267 IRP_MJ_READ Serial0 SUCCESS Length 1: F0 22 0.00002310 IRP_MJ_WRITE Serial0 SUCCESS Length 1: 02 23 0.00000359 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 24 0.04407666 IRP_MJ_READ Serial0 SUCCESS Length 1: 02 25 0.00004157 IRP_MJ_WRITE Serial0 SUCCESS Length 1: 00 26 0.00000411 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 27 0.04361267 IRP_MJ_READ Serial0 SUCCESS Length 1: 00 28 0.00003952 IRP_MJ_WRITE Serial0 SUCCESS Length 1: F2 29 0.00000308 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 30 0.04404176 IRP_MJ_READ Serial0 SUCCESS Length 1: F2 31 0.00000308 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 32 0.05498560 IRP_MJ_READ Serial0 TIMEOUT Length 0: 33 0.00000359 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 34 0.05494403 IRP_MJ_READ Serial0 TIMEOUT Length 0: 35 0.00000411 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 36 0.05492658 IRP_MJ_READ Serial0 TIMEOUT Length 0: 37 0.00000359 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 38 0.05493582 IRP_MJ_READ Serial0 TIMEOUT Length 0: 39 0.00000411 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 40 0.05493274 IRP_MJ_READ Serial0 TIMEOUT Length 0: 41 0.00000359 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS |
19 0.00003028 IRP_MJ_WRITE Serial0 SUCCESS Length 1: F0 20 0.00000308 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 21 0.00553711 IRP_MJ_READ Serial0 SUCCESS Length 1: F0 22 0.00002772 IRP_MJ_WRITE Serial0 SUCCESS Length 1: 02 23 0.00000411 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 24 0.00545858 IRP_MJ_READ Serial0 SUCCESS Length 1: 02 25 0.00002669 IRP_MJ_WRITE Serial0 SUCCESS Length 1: 00 26 0.00000359 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 27 0.00548219 IRP_MJ_READ Serial0 SUCCESS Length 1: 00 28 0.00002926 IRP_MJ_WRITE Serial0 SUCCESS Length 1: F2 29 0.00000411 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 30 0.01288655 IRP_MJ_READ Serial0 SUCCESS Length 1: F2 31 0.00000257 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 32 0.00000257 IRP_MJ_READ Serial0 SUCCESS Length 1: F0 33 0.00000205 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 34 0.00000205 IRP_MJ_READ Serial0 SUCCESS Length 1: 03 35 0.00000205 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 36 0.00000205 IRP_MJ_READ Serial0 SUCCESS Length 1: 01 37 0.00000154 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 38 0.00000205 IRP_MJ_READ Serial0 SUCCESS Length 1: 53 39 0.00000205 IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS 40 0.00000257 IRP_MJ_READ Serial0 SUCCESS Length 1: 47 41 0.00002053 IRP_MJ_WRITE Serial0 SUCCESS Length 1: F0 |
I believe that there is a some setting/trick in Cisco, because all of my serial apps works fine via Moxa NPorts serial-to-Ethernet adapters (they are async only). With no any manual settings, just IP settings and everything works fine.
But I need to run Cisco.
Any ideas, guys?
10-27-2017 11:18 AM
Hello,
not sure if this is in any way helpful, but what if you use UDPTN as the transport ?
https://www.cisco.com/c/en/us/td/docs/ios/12_2/dial/configuration/guide/fdial_c/dafudptn.pdf
10-27-2017 12:37 PM - edited 10-27-2017 12:39 PM
Hi Georg! Why not? But what encapsulations you see for UDPTN?
interface serial 0/2/0 physical-layer async no ip address encapsulation ? clock rate 9600 shut no shut exit ! line 0/2/0 speed 9600 no session-timeout transport output udptn dispatch-timeout 10000 dispatch-character 13 modem in autocommand udptn 192.168.1.144 |
interface serial 0/2/0 physical-layer async no ip address encapsulation ? shut no shut exit ! ! line 0/2/0 speed 9600 no session-timeout transport output udptn dispatch-timeout 10000 dispatch-character 13 modem in autocommand udptn 192.168.1.143 |
10-27-2017 01:00 PM
The encapsulation stays the same, you just change the transport protocol under the line config. The document I linked to provides a few samples...
10-27-2017 01:04 PM - edited 10-27-2017 01:16 PM
Of course I took config example from PDF you provided. I chosen P2P option, because it fit my application (from description). Unfortunately, that's file has nothing on serial interfaces configuration (this part is omitied at all for some reason). So, I have to set it by my own. But I am not a Cisco guru. For example, I am not sure what shall I do with these lines?
interface serial 0/2/0 -- this line remains unchanged physical-layer async -- this line remains unchanged encapsulation bstun -- this line remains unchanged asp role ... -- but this line? bstun group 103 -- but this line? bstun route all tcp 192.168.168.x -- but this line?
Also I come across with this thing:
2811_2#udptn 192.168.1.143 % udptn connections not permitted from this terminal
10-27-2017 01:42 PM
Hello,
I think UDPTN is IOS and platform specific. The 2811 with 15.1.(3)T4 Advanced Enterprise Services supports it, as an example. Which IOS are you running ?
10-27-2017 01:45 PM
I run:
2811_1# show ver Cisco IOS Software, 2800 Software (C2800NM-ADVENTERPRISEK9-M), Version 15.1(4)M12a, RELEASE SOFTWARE (fc1) ... ROM: System Bootstrap, Version 12.4(13r)T, RELEASE SOFTWARE (fc1)
10-27-2017 01:51 PM
Hello,
according to the feature navigator, your IOS version should support it. Try and enable 'service udp-small-servers' globally...
10-27-2017 02:04 PM
Tried, but same error. How about to configure everyting else first? Like a few lines in serial interface with my notes? Maybe problem is there.
10-27-2017 02:27 PM
Hello,
I am getting the same error on anything in GNS3 and VIRL...weird.
I'll check if I can find some more info...
10-27-2017 02:51 PM
Okay, thanks anyway.
Do you have other option ideas for async tunneling? I don't like UDP idea too much, maybe any other options available, based on TCP? SDLC or Frame Relay maybe?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide