Answer the question
In order to leave comments, you need to log in
Implementing your own TCP(UDP)/IP stack, how to get an answer?
Good afternoon. It so happened that you need to implement your own TCP (UDP) / IP stack. The application logic resides at the OSI network layer (OSI level 3), i.e. there is a file descriptor from which I can read\write IP datagrams, then I can process each frame in accordance with the TCP / UDP protocol (and this is the OSI transport level - 4). Actually questions:
1. For the TCP protocol, you need to establish a connection and keep "somewhere" a bunch of ip/port str/dst and its socket? (we connect corny - we create a socket through socket and stupidly connect?)
1.1 In a separate thread (fork) to hammer a recv socket to receive data?
1.2 What about protocol flags?
2. The same thing, but for UDP, only TCP / UDP is of interest so far (God forbid, I’ll get to ICMP, but that’s another story, despite the fact that it works in parallel with IP)
ps rummaged through ready-made implementations, as it is not clear how they handle connections. Probably a habit from working with sockets in applications where you don't care about it.
pps I looked in the direction of dunkels.com/adam/miniweb as an example, but there is some kind of tin there, they receive packets from tun-a and send them back to it, is this some kind of trick?
Answer the question
In order to leave comments, you need to log in
Alexander Kolesen - Implementing open-source TCP / IP with ...
Look, here a person implemented a tcp stack on top of userspace on android
God forbid, I will reach ICMP
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question