12 - More on Flow Control
Announcements:
-
P2 will be announced likely tomorrow (after lab)
We'll be continuing Flow Control from yesterday.
Gigabit Ethernet 0/2/0
mean?
- The first number indicates level in the stack (moving up)
- The next number is the slot number (by width)
- The last number is an "out" slot number (ie: some devices have replacable slots, so you'd use this to dilineate. Often this will be just
0
)
Lab For Tomorrow
For the lab tomorrow making the Routing Table requires (doing on the Router):
- A directly connected subnet
- The interfaces are automatically entered when connected (ex:
GE 0/0/0
andGE 0/0/1
) - Static Routes: manually entered routes. We'll add these as we need.
- Dynamic Routes: Like RIP or OSPF
- Gateway of Last Resort (the last thing tried)
You'll be able to setup your subnet and your gateway of last resort to setup the right network. For example for:
you may have different subnets based on your Network Topologies. That will mean your routing table will have different static routes depending on configuration. For example, the 8 subnet example above would have 3 static routes per router. If you didn't set your gateway of last resort, the router will start dropping your packets and you'll not know why.
Set your default gateway, probably by ip route 0.0.0.0 0.0.0.0 <next-hop>
. The 0.0.0.0
's are the destination subnet and mask respectively (used for anything other than default gateway).
If even one default gateway is missing, you will not get a ping from any device (especially very disconnected, far away devices). Even if you do set it up, you may accidentally create a loop that would kill the packet via TTL
:
As long as you are being the router and considering how a ping
request will get filled out logically, you should be fine.
Lastly, you really need to focus on making the diagram, and not just finishing the lab. You'll need it for the following week.
P3 Sliding Windows Protocol
You're going to write a server software rcopy
(for the copy) such that we'll use UDP that's a Handshake Protocol (Connection Oriented):
You're going to implement the flow control here, namely the Use step of our Handshake protocol.
This is different than program 2, since while you are still using 3 Sockets Program, recv() and poll(), you have to still fork()
and do this poll()
in the child instead. You have to essentially forward all of this data to the child.
Note though that this is UDP, not TCP, so you only send and recieve the exact number of bytes you're asking for:
recvfrom(socket num, max length, fromField, fieldLen);
// The `fromField` has info on IP and port #
sendto(socket num, buffer, length, fromField, fieldLen);
Note also that every client only knows about the one child. There may be multiple children, but one rcopy
instance only communicates with one child.
bind()
only in the main program in server
(ie: not in the child processes).The communication between this rcopy
and this child
is what you are designing for in 4 Stop and Wait Design Process. You can design it by:
- Close a socket and open a new one on
rcopy1
when theACK
is not gotten byrcopy1
. Then try to start a new session all over again. - ... (there's alterations to this you can try).
Just make sure you read the spec again after reading this (at least 10 times you motherfucker).
Back to Flow Control
Use a struct
with a valid flag
to clear entries from your buffer, rather than say write all 0
's.