300 likes | 437 Views
CS 453 Computer Networks. Lecture 18 Introduction to Layer 3 Network Layer. Network Layer. So far, our communications has assumed that everything is point to point… We have a message at A and we send it to B We had, in layers 1 and 2, channels that gave us a “connection” between A and B.
E N D
CS 453Computer Networks Lecture 18 Introduction to Layer 3 Network Layer
Network Layer • So far, our communications has assumed that everything is point to point… • We have a message at A and we send it to B • We had, in layers 1 and 2, channels that gave us a “connection” between A and B
Network Layer Granted, we discussed a lot of media and protocols to make these connections… …and we had hubs and switches in the middle… But the intervening media (and hubs and switches) to took care of path… And made it seem like a “wire”
Network Layer Well, as you probably have guessed, its usually not that simple Once we push our networking out past a LAN we have a new realm of complications Internetworking LANs or even stations is the domain of the network layer
Network Layer Stations connect to networks, networks connect to other network, which connect to other networks,…. Networks take on complex topologies Fundamentally, the job of the network layer is to take messages from the transport layer and create packets for the data link layer It must do this in the context of the topology of the network
Network Layer Application Layer Transport Layer Network Layer Data Link Layer From: http://en.wikipedia.org/wiki/Tcp/ip
Network Layer From: http://en.wikipedia.org/wiki/Tcp/ip
Network Layer • Network layer services • Independent of router technology • Network topology, technology should be transparent to the Transport layer • Addressing scheme should be uniform • Two classes • Connectionless Service • Connection-oriented Service
Network Layer • Connectionless Service • Strongly advocated by the Internet community • Underlying principle of the Internet • That the Network layer should • Send Packets • Receive Packets • And that’s about it
Network Layer • Connectionless Service • Packets are fed into the network • Network must route packets to destination • Packets are routed to destination independently • Packets transmitted in connectionless context are often referred to as datagrams • A connectionless network or portion thereof, might be called a datagram subnet
Network Layer • Connectionless Service • Think of a datagram like a postal letter • You drop it in the mailbox and it arrives at its destination • It could have taken any of several destinations to get there,… • But figuring that out is not your problem • Imagine sending several letters to the same destination • They all arrive, but… • They may have taken different routes to get there
Network Layer • Connectionless Service • Imagine that the transport layer (a process) in host H1 has a message to send to host H2, and,… • … it is a big message – 4 times the max packet size • The network layer takes the message and breaks into 4 packets, and sends it…
Network Layer Connectionless Service From: Tanenbaum, 2003, pg. 346
Network Layer • Connectionless Service • Note: each packet can take a different route • Route decisions are made by the routers… • On packet by packet basis • Route decisions are made based on route tables located in each route • Route table does not tell exact how to get to the destination, but which direction (which router port, or connection link)
Network Layer Each router has its own table Each table entry says for a given destination address – send the packet out on this port So, in router A, a packet with a destination of F is sent to port C (like to router C) .. At least initially Router C gets the packet, see that it is destined for F sends it out on port E Notice that router A’s route table changes so that packets headed for F get sent to B (rather than C) Connectionless Service From: Tanenbaum, 2003, pg. 346
Network Layer • Connectionless Service • Routers can change their route tables • Routers’s job to maximize the flow of packets • May change route tables because • Link down • Congested link • … • Router decisions and route table updates are Routing Algorithms • Routing Algorithms - complex topic • We will look at Routing Algorithms in more detail
Network Layer • Connectionless Service • By the way, this is the way IP routing works
Network Layer • Connection-Oriented Service • Route through network established before packets flow • Fixed route • Once defined all packets flow through the same route • Referred to as a Virtual Circuit • When a sending host wants to send a packet… • The network first sends a setup packet • The setup packet finds a path and … • Make forwarding table entries along the path
Network Layer • Connection-Oriented Service • Virtual Circuit has a connection ID • Once a packet is assigned a connection ID (a label) it no longer needs a destination address • Packet follows the virtual circuit, … • …not routed by destination address • Sort of like a phone call – once you are talking the other person, you don’t need their phone number to continue the conversation • When the packet stream is finished, the connection is released, and …. • The virtual circuit is torn-down
Network Layer Connection-Oriented Service From: Tanenbaum (2003), pg 348
Network Layer • Connection-Oriented Service • Once the circuit is know the virtual circuit label is added to the packet • Virtual circuit labels are per hop • …that is, the label in a packet can be changed by the routers along the route
Network Layer • Connection-Oriented Service • In the previous diagram, H1, then H3 initiate the flow of packets. • H1 establishes VC 1, so it VC label is 1 • H3 starts a flow of packets, • …and since it is coorinating with H1, it assigns the VC with label 1… • But Router A recognizes that VC 1 belongs to another packet flow,…so • It renames the VC as 2, • From A to the destination then that VC is VC 2…
Network Layer • Connection-Oriented Service • So, at A the router removes the VC label from the connection Id field of the packet header, and… • …replaces it the new VC number (2, in this example) • Replacing a label in route is called “label switch” • We will talk about this more later
Network Layer • So, how do they compare • Connectless vs. Connection-Oriented Service • Datagrams vs. Virtual Circuits • Datagrams must carry full source and destination addresses • VC packets only carry the VC Label • Datagram addresses must be parse and translated at each hop • VC packet label simply used as a lookup
Network Layer • So, how do they compare • Connectionless service requires no setup • Send a datagram and the routers will help it find its way • No pretransmission overhead • Overhead per packet • Connection-Oriented Services requires the VC to be setup before packet flow • Setup packet sent first to establish VC • For short transactions – a packet or two – connection-oriented service very expensive
Network Layer • So, how do they compare • Resilency to failure - router failure, line failure • Connectionless – good, basically doesn’t care • Not a problem – routers find a different route • Connection Oriented – big problem • VC torn down, packet flow lost • New VC must be established be transmission restarted
Network Layer • So, how do they compare • Quality of Service • Connectionless Service • None, difficult, maybe • Connectionless – best available • Connection-Oriented Service • Good, easy to establish • Resources can be reserved when VC is setup
Network Layer • So, how do they compare • Traffic load, congestion handling • Connectionless Service • Not much, sort of • Connection-Oriented • Easy, reliable • Reserve resources (bandwidth) at VC setup