

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Goal: Implement unreliable rate-controlled message delivery to neighbours.
DUE: April 3. That’s a monday. The late deadline will be Friday, April 7; you have only one late deadline to play with.
This project extends the previous project by providing rate-controlled message delivery called sendmsg.^1 The rate- control requirement ensures that messages from a host do not swamp its neighbours or the network. Because the service runs over UDP (over IP), it is unreliable. The rate control is the so-called “leaky bucket” algorithm. Water (packets) pours into a leaky bucket (queue). When the bucket has water, it leaks steadily (sends at fixed rate). If the incoming water flow is so fast that it fills the bucket (queue is filled), water spills out (packets are dropped).
The sendmsg service : Takes dst-address, the neighbour’s logical address (the 32 bit source address in the packet header), and msg, a message to send, as parameters Limits the rate of sending to 10 packets (of maximum size 1000 bytes each) per second to each neighbour Uses a per-neighbour output queue of maximum size 10 packets (irrespective of packet size) to limit the sending rate
When sendmsg is invoked, it does the following in sequence: Look up the IP address of the neighbour in the neighbour table. (Don’t send messages to the multicast address!) Check if last packet was sent 0.1 seconds ago or earlier:
- If so, send the message immediately using UDP sendto - If not, enqueue the message in the output queue subject to maximum queue size - If the queue is full, drop packet Ensures that the queue, if not empty, is drained by one packet every 0.1 seconds.
The sendmsg service can return the following errors: Unknown or dead neighbour Queue overflow (^1) Think of sendmsg as a wrapper over UDP sendto. This is an example of how services are composed over layers, i.e., a higher protocol layer uses a lower layer’s service specification to provide something more.
In addition to the requirements of P2, P3 should: