Raw Socket IN-OUT Mode Configuration

This section lists the CLI configuration steps for IN-OUT Mode Configuration for Raw Socket connection.

Configure VLAN 1.

Type the following:

  • Enter the Global Configuration Mode.
iS5comm# configure terminal
  • Enter the Interface Configuration Mode.
iS5comm(config)# interface vlan 1
  • Configure VLAN 1.
iS5comm(config-if)# no shutdown
iS5comm(config-if)# ip address 192.168.0.40 255.255.255.0
iS5comm (config-if)# end

  • Enter the Global Configuration Mode.
iS5comm# configure terminal
  • Enter the Interface Configuration Mode for 0/9.
iS5comm(config)# interface serial 0/9
  • For example, configure the baud rate.
iS5comm(config-serial-if)# baud-rate 115200
iS5comm (config-serial-if)# no shutdown
iS5comm (config-serial-if)# end

Running Client and Server Modes

  1. Map the profile without preparing the server for connection or connecting a client.

    Type the following:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Configure profile PROF_9_IN_OUT profile.
    iS5comm(config)# serial connection-type raw profile PROF_9_IN_OUT
    iS5comm(raw-PROF_9_IN_OUT)# transport protocol tcp
    iS5comm(raw-PROF_9_IN_OUT-TCP)# direction in-out
    iS5comm(raw-PROF_9_IN_OUT-TCP-InOut)# local client port 15011
    iS5comm(raw-PROF_9_IN_OUT-TCP-InOut)# local server port 15010
    iS5comm(raw-PROF_9_IN_OUT-TCP-InOut)# remote ipv4 address 192.168.0.100 port 15011
    iS5comm(raw-PROF_9_IN_OUT-TCP-InOut)# EXIT
    iS5comm(raw-PROF_9_IN_OUT-TCP)# EXIT
    iS5comm(raw-PROF_9_IN_OUT)# connection-map interface serial 0/9
    iS5comm(raw-PROF_9_IN_OUT)# END
  2. Run one of the commands "show serial profile all" or "show serial profile name YOUR_PROFILE_NAME" or "show serial profile interface serial 0/YOUR_INT_NUM" to verify the connection status of the IN_OUT profile (it should be not connected).

    Type the following:

    iS5comm# show serial profile interface serial 0/9
    Profile : PROF_9_IN_OUT
    Serial interface : 9
    Protocol : RAW Socket
    Serial interface : 9
    Mode : Client/Server
    Direction : InOut
    Transport : TCP
    Remote Server IP        : 192.168.0.100
    Remote Server Port      : 15011
    Local Server Port       : 15010
    Serial RX byte counter  : 0
    Serial TX byte counter  : 0
    Local Client Port       : 15011
    KeepAlive interval (sec): 240
    Reconnect timer(sec)    : 4
  3. Verify with the WireShark connection attempts done within the configured reconnect timer interval; actual attempts in software are done every “Reconnect timer(sec)” seconds, can be seen when “debug serial critical” is configured, but Wireshark shows only those attempts which are executed only when TCP stack is ready to execute them. So if the reconnect timeout is big, the Wireshark attempts are executed with the “reconnect timer” attempts.

Accepting Connection as a Server

  1. Connect with a client application to the server using a configured server IP and port.
  2. Open serial application to the configured serial interface number using the configured serial parameters.
  3. Run one of the commands "show serial profile all" or "show serial profile name YOUR_PROFILE_NAME" or "show serial profile interface serial 0/YOUR_INT_NUM" to verify the connection status and if the mode became a server.

    Type the following:

    iS5comm# show serial profile interface serial 0/9
    Profile : PROF_9_IN_OUT
    Serial interface : 9
    Protocol : RAW Socket
    Serial interface : 9
    Mode : Server
    Direction : InOut
    Transport : TCP
    Local Server Port       : 15010
    Number of clients       : 1
    Serial RX byte counter  : 0
    Serial TX byte counter  : 0
    KeepAlive interval (sec): 240
    Dynamic master enabled  : 0
    Max connections         : 64
    Packetizing             : OFF
    TCP buffering           : disabled
    Turnaround delay(msec)  : 0
    Hold time(msec)         : 0
    Rx-to-Tx delay(msec)    : 1000
    Client  1 IP            : 192.168.0.100
    Client  1 port          : 5299
    1Client  1 byte counter  : 0
  4. Verify with the WireShark that connection attempts are stopped.

Testing Server Mode

Perform configurations and tests from the Server Configuration - refer to the section Raw Socket Server Mode Configuration.All tests should give the same results.

Note: REPLACE the profile name and direction with following:
iS5comm # configure terminal
iS5comm(config)# serial connection-type raw profile PROF_9_IN_OUT
iS5comm(raw-PROF_9_IN_OUT)# transport protocol tcp
iS5comm(raw-PROF_9_IN_OUT-TCP)# direction in-out
Note:

No need to configure VLAN1 and serial interface baud rate again.

Don’t delete the profile at the end of server testing.

Going back to Client and Server Modes

  1. Close the client application.
  2. Use Wireshark to verify that Client mode reconnect attempts are back.
  3. Run one of the commands "show serial profile all" or "show serial profile name YOUR_PROFILE_NAME" or "show serial profile interface serial 0/YOUR_INT_NUM" to verify the connection status of the INOUT profile (it should be not connected).

    Type the following:

    iS5comm# show serial profile interface serial 0/9
    Profile : PROF_9_IN_OUT
    Serial interface : 9
    Protocol : RAW Socket
    Serial interface : 9
    Mode : Client/Server
    Direction : InOut
    Transport : TCP
    Remote Server IP        : 192.168.0.100
    Remote Server Port      : 15011
    Local Server Port       : 15010
    Serial RX byte counter  : 0
    Serial TX byte counter  : 0
    Local Client Port       : 15011
    KeepAlive interval (sec): 240
    Reconnect timer(sec)    : 4

Connecting as Client

  1. Start Server to accept connection from the client.
  2. Run one of the commands "show serial profile all" or "show serial profile name YOUR_PROFILE_NAME" or "show serial profile interface serial 0/YOUR_INT_NUM" to verify the connection status in Client Mode (it should be connected).

    Type the following:

    iS5comm# show serial profile interface serial 0/9
    Profile : PROF_9_IN_OUT
    Serial interface : 9
    Protocol : RAW Socket
    Serial interface : 9
    Mode : Client
    Direction : Out
    Transport : TCP
    Remote Server IP        : 192.168.0.100
    Remote Server Port      : 15011
    Serial RX byte counter  : 0
    Serial TX byte counter  : 0
    Network byte counter    : 0
    Connection to server    : YES
    Local Client Port       : 15011
    KeepAlive interval (sec): 240
    Reconnect timer(sec)    : 4
    Packetizing             : OFF
    TCP buffering           : disabled
    Turnaround delay(msec)  : 0
    Hold time(msec)         : 0
    Rx-to-Tx delay(msec)    : 1000

Testing Client Mode

Perform configurations and tests from the Client Configuration - refer to the section Raw Socket Client Mode Configuration. All tests should give the same results.

Note: REPLACE the profile name and direction with following:
iS5comm # configure terminal
iS5comm(config)# serial connection-type raw profile PROF_9_IN_OUT
iS5comm(raw-PROF_9_IN_OUT)# transport protocol tcp
iS5comm(raw-PROF_9_IN_OUT-TCP)# direction in-out
Note:

No need to configure VLAN1 and serial interface baud rate again.

Don’t delete the profile at the end of server testing

Clearing the Serial Profile Configuration and Deleting the Profile

  1. Delete the profile and set the Rx-to-Tx delay to 0.

    Type the following:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    iS5comm(config)# no serial profile PROF_9_IN_OUT
    iS5comm(raw-PROF_9_IN_OUT)# end

    iS5comm # configure terminal
    iS5comm(configure)# interface serial 0/9
    iS5comm(config-serial-if)# shutdown
    iS5comm(config-serial-if)# rx-to-tx delay 0
    iS5comm(config-serial-if)# no shutdown
    iS5comm(config-serial-if)# end

  2. Run “show serial profile interface serial 0/9” to verify that profile is not mapped.