How would a tcp icmp look like? :confused:
Printable View
How would a tcp icmp look like? :confused:
Well to a length of cable, it looks like a series of electical voltage changes.
To a NIC, it's probably just an array of bytes.
Tcp and icmp are two different protocols.
Can you write own protocols in C?I am talking about the tcp and icmp headers.do i have to be root to do this on linux?
Yes. But if you want to write protocols in or below level 3 (network), it's operating system dependent. Otherwise, you can use sockets.
Could Make a tcp header but if i want to make my own tcp header i have to be in root.What you mean by socket's?I still a newbie at this.:)
TCP Header Format
Quote:
TCP Header Format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Acknowledgment Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data | |U|A|P|R|S|F| |
| Offset| Reserved |R|C|S|S|Y|I| Window |
| | |G|K|H|T|N|N| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Urgent Pointer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
TCP and ICMP headers have standard structures. Do you mean creating your own TCP header for the packet. ? If yes, then you will have to use RAW sockets to do that. To use RAW sockets in your program you have to be a superuser (like root on *nix systems).
Check this URL. It has good info on RAW sockets and how to construct TCP, UDP and ICMP headers.
Thanks,
So i take it i can do some socket in usr on linux that if i am right?
What do you mean by OS dependent? How could one create layer 2 packets?Quote:
Originally Posted by Sang-drax