Skip to content
Snippets Groups Projects
Commit 50f6346b authored by Selby, Nicholas Stearns's avatar Selby, Nicholas Stearns
Browse files

Updated onReceive algorithm

parent a1392965
Branches
No related tags found
No related merge requests found
...@@ -136,27 +136,23 @@ We develop a router, protocol and implementation of a network that: ...@@ -136,27 +136,23 @@ We develop a router, protocol and implementation of a network that:
On Packet Received: On Packet Received:
```swift ```swift
if hop count > max: if the packet is not a buffer update:
kill packet update the LUT using packet src. and hop count
increment hop count
if packet is standard: if packet is standard:
if LUT does not already have source address:
add entry to LUT
if I am destination: if I am destination:
process data in packet process data in packet
reply with ACK
else: else:
increment hop count
if LUT has destination address: if LUT has destination address:
send packet to port which minimizes C(hops, buffer) = hops + \lambda*buffer over all ports send packet to port which minimizes C(hops, buffer) = hops + \lambda*buffer over all ports
else: else:
send packet to all ports as standard flood send packet to all ports as standard flood
elseif packet is ack: elseif packet is ack:
if LUT does not already have source address:
add entry to LUT
if I am destination: if I am destination:
process acknowledgement, increment window process acknowledgement
else: else:
increment hop count increment hop count
if LUT has destination address: if LUT has destination address:
...@@ -165,28 +161,26 @@ elseif packet is ack: ...@@ -165,28 +161,26 @@ elseif packet is ack:
send packet to all ports as ack flood send packet to all ports as ack flood
elseif packet is standard flood: elseif packet is standard flood:
if LUT does not already have source address: remove packet src. from LUT at that port if it exists
add entry to LUT if I have not yet seen this flood:
if I am destination: if I am destination:
process data in packet process data in packet
open window for duplicate packet elimination reply with ACK
check previous duplicates
else: else:
increment hop count
if LUT has destination address: if LUT has destination address:
send packet to port which minimizes C(hops, buffer) = hops + \lambda*buffer over all ports send packet to port which minimizes C(hops, buffer) = hops + \lambda*buffer as standard packet
else: else:
send packet to all ports send packet to all ports
elseif packet is ack flood elseif packet is ack flood
if LUT does not already have source address: remove packet src. from LUT at that port if it exists
add entry to LUT
if I am destination: if I am destination:
process acknowledgement, increment window process acknowledgement
open timer for duplicate ack elimination
check previous duplicates
else: else:
increment hop count
if LUT has destination address: if LUT has destination address:
send packet to port which minimizes C(hops, buffer) = hops + \lambda*buffer over all ports send packet to port which minimizes C(hops, buffer) = hops + \lambda*buffer as standard ACK
else: else:
send packet to all ports send packet to all ports
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment