简体   繁体   中英

TCP packet simulation + omnet

Lets say that I have a function todo() and I want to implement this function on a packet sent from a node to a destination among all the routers.

So I want that the packet goes through TCP via ethernet(could be anything) and while going I want to process the packet by calling todo() on it.

I am trying to simulate this on omnet and thus wanted advice on it...

Do i need to implement the entire TCP stack first or is there an inbuilt feature for simulation in it and if there is does it allow me to do the thing I mentioned ??

I am a beginner in using omnet so please provide me with guidelines on how to do this.... Thanks a lot ...

Your question is little confusing. Routers process IP packets. They dont care about the payload, which might contain a TCP segment.

You have a scenario like this:

Client -> Router -> Server

So the Client will create on L7 a packet and gives it to TCP module. There you can add your function. For example in the sendToIP function The packet goes to IP and goes out via Ethernet to the Router. Router looks at destination IP address and send it out the interface as configured in routing table. The server will receive the packet. it goes through its tcp module (their you can also add your todo() function) and gives it to your application module.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM