As title, I need to implement TCP/IP stack on Embedded System that doesn't have Ethernet, only RS232. assume you understand what is TCP/IP over SLIP. If not, just google it.
The following shows how to setup your GNU/Linux PC running Ubuntu (hopefully, any version) to implement TCP/IP over SLIP, so you can test the other end. The example below will use 2 PCs running Ubuntu. Once you get it running, you can replace one end with other device, in my case, my Embedded System.
Check if slip module is in your system:
$> find /lib/modules/$(uname -r) -name slip*
Load slip module:
$> modprobe slip
If you want to automatically load it during startup, edit:
Now, link Serial port with TCP/IP so we can access it using IP address. The example below using Serial port /dev/ttyUSB3 running at 115200bps.
$> sudo slattach -p slip -s 115200 / dev/ttyUSB3 &
Check device name, look for something like sl0, sl1.
$> ifconfig -a
Assume it's sl0, assign static IP address to it. Because SLIP is point-to-point connection, you also need to tell the IP address of the other end. The example below says, my Serial port sl0 is assigned IP address of 188.8.131.52 and is connected to other end Serial port that is assigned IP address of 184.108.40.206.
$> sudo ifconfig sl0 220.127.116.11 pointopoint 18.104.22.168 upRepeat all of the above on the other end swapping IP addresses during ifconfig setup.
Try ping each other. If you are on 22.214.171.124:
$> ping 126.96.36.199
If you are on 188.8.131.52:
$> ping 184.108.40.206
If you find it too slow, try change the baudrate.
That's it. Try other program to talk to each other like web browser, telnet, ssh, etc. Once you know it's working, replace the other end with any device that supports TCP/IP over SLIP.
Hope you find it usefull.