Open TCP or UDP Linux sockets from the bash shell and verify that the socket entries are programmed into the Local Packet Transport Services (LPTS) infrastructure to distribute traffic to the hosted application.
Use this procedure to open Linux sockets so that applications can receive traffic from IOS XR interfaces. Socket entries are programmed into the LPTS infrastructure, which distributes the information through the line cards. Any packet received on a line card interface triggers an LPTS lookup to direct the packet to the application that opened the socket.
Procedure
-
From the bash shell, open a TCP socket using netcat and verify that applications open sockets.
Example:
Router#bash
[ios:~]$ nc -l 0.0.0.0 -p 5000 &
[1] 1160
[ios:~]$
[ios:~]$netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN 1160/nc
tcp 0 0 0.0.0.0:57777 0.0.0.0:* LISTEN 14723/emsd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 8875/ssh_server
tcp6 0 0 :::22 :::* LISTEN 8875/ssh_server
udp 0 0 0.0.0.0:68 0.0.0.0:* 13235/xr_dhcpcd
[ios:~]$exit
Logout
Router#
Netcat starts listening on port 5000, which appears as an IPv4 TCP socket in the netstat output, as in a typical Linux kernel. This socket is programmed to LPTS, which creates a corresponding hardware entry to look up TCP port 5000. Incoming traffic is redirected to the kernel of the active RP where netcat runs.
-
Verify that the socket is programmed into the LPTS infrastructure.
Example:
Router#show lpts pifib brief | i 5000
Thu Aug 1 17:16:00.938 UTC
IPv4 default TCP any 0/RP0/CPU0 any,5000 any
The LPTS entry for TCP port 5000 confirms that traffic destined for that port is correctly directed to the Linux application through the Packet I/O infrastructure.
The Linux socket is open and the LPTS entry confirms that the IOS XR packet infrastructure will direct matching traffic to the application.