Hello, I\'ve got to create a node and get it to broadcast distance vectorpackets
ID: 3615364 • Letter: H
Question
Hello,I've got to create a node and get it to broadcast distance vectorpackets through socket programming (UDP sockets). The user inputsthe distance costs initially, then computes the distance vector,and send the packets over to the network. The user should also beable to change the distance any time in between. The program shouldbe such that any computer over the network can receive thosepackets and send back its own distance vector packets (with thatoriginal node program). Those distance vectors are supposed to bedisplayed. The sending and receiving is to be done throughthreading. I am new to socket programming, can't figure out how toactually begin. If someone could outline the steps (what to dofirst), I would appreciate it very much. Some things that Ispecifically don't understand are:
1. How do I create a packet, don't understand the methodcompletely, do I need to include ethernet and arp headers? Or justsimple send the distance vector info through the buffer?
2.How does UDP broadcast (or multicast) packets over thenetwork?
3. Do I simply just form a distance vector function, then create aUDP socket and broadcast the distance vector calculated over thenetwork?
4. One more question, while searching I came upon this term'Distance Vector Multicast Routing Protocol', don't fullyunderstand it yet, but does it have anything to do with myassignment?
Explanation / Answer
1. How do I create apacket, don't understand the method completely, do I need toinclude ethernet and arp headers? Or just simple send the distancevector info through the buffer?
You need not to create packet, just create socket,connect to the server (if tcp) and send data, it willatutomatically create packet.
2.How does UDP broadcast(or multicast) packets over the network?
just use multicast address in binding ofsocket.
see example:
http://ntrg.cs.tcd.ie/undergrad/4ba2/multicast/antony/example.html
3. Do I simply just form a distance vector function, then create aUDP socket and broadcast the distance vector calculated over thenetwork?
yes , but u wll bind too after creation ofsocket.
4. One more question,while searching I came upon this term 'Distance Vector Multi castRouting Protocol', don't fully understand it yet, but does it haveanything to do with my assignment
It's like normal distance vector , it's only usemulticasting to send it's information to other router rather thanunicast.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.