30
CS 453 CS 453 Computer Networks Computer Networks Lecture 18 Lecture 18 Introduction to Layer 3 Introduction to Layer 3 Network Layer Network Layer

CS 453 Computer Networks Lecture 18 Introduction to Layer 3 Network Layer

Embed Size (px)

Citation preview

CS 453CS 453Computer NetworksComputer Networks

Lecture 18Lecture 18

Introduction to Layer 3Introduction to Layer 3

Network LayerNetwork Layer

Network LayerNetwork Layer

So far, our communications has assumed So far, our communications has assumed that everything is point to point…that everything is point to point… We have a message at A and we send it to BWe have a message at A and we send it to B

We had, in layers 1 and 2, channels that We had, in layers 1 and 2, channels that gave us a “connection” between A and Bgave us a “connection” between A and B

Network LayerNetwork Layer

Granted, we discussed a lot of media and Granted, we discussed a lot of media and protocols to make these connections…protocols to make these connections…

……and we had hubs and switches in the and we had hubs and switches in the middle…middle…

But the intervening media (and hubs and But the intervening media (and hubs and switches) to took care of path…switches) to took care of path…

And made it seem like a “wire”And made it seem like a “wire”

Network LayerNetwork Layer

Well, as you probably have guessed, its Well, as you probably have guessed, its usually not that simpleusually not that simple

Once we push our networking out past a Once we push our networking out past a LAN we have a new realm of LAN we have a new realm of complicationscomplications

Internetworking LANs or even stations is Internetworking LANs or even stations is the domain of the network layerthe domain of the network layer

Network LayerNetwork LayerStations connect to networks, networks Stations connect to networks, networks connect to other network, which connect to connect to other network, which connect to other networks,….other networks,….

Networks take on complex topologiesNetworks take on complex topologies

Fundamentally, the job of the network layer Fundamentally, the job of the network layer is to take messages from the transport layer is to take messages from the transport layer and create packets for the data link layerand create packets for the data link layer

It must do this in the context of the topology It must do this in the context of the topology of the networkof the network

Network LayerNetwork Layer

From: http://en.wikipedia.org/wiki/Tcp/ip

Data Link Layer

Network Layer

Transport Layer

Application Layer

Network LayerNetwork Layer

From: http://en.wikipedia.org/wiki/Tcp/ip

Network LayerNetwork Layer

Network layer servicesNetwork layer services Independent of router technologyIndependent of router technology Network topology, technology should be Network topology, technology should be

transparent to the Transport layertransparent to the Transport layer Addressing scheme should be uniformAddressing scheme should be uniform

Two classesTwo classes Connectionless ServiceConnectionless Service Connection-oriented ServiceConnection-oriented Service

Network LayerNetwork Layer

Connectionless ServiceConnectionless Service Strongly advocated by the Internet communityStrongly advocated by the Internet community Underlying principle of the InternetUnderlying principle of the Internet That the Network layer shouldThat the Network layer should

Send PacketsSend Packets

Receive PacketsReceive Packets

And that’s about itAnd that’s about it

Network LayerNetwork Layer

Connectionless ServiceConnectionless Service Packets are fed into the networkPackets are fed into the network Network must route packets to destinationNetwork must route packets to destination Packets are routed to destination Packets are routed to destination

independentlyindependently Packets transmitted in connectionless context Packets transmitted in connectionless context

are often referred to as datagramsare often referred to as datagrams A connectionless network or portion thereof, A connectionless network or portion thereof,

might be called a datagram subnetmight be called a datagram subnet

Network LayerNetwork LayerConnectionless ServiceConnectionless Service Think of a datagram like a postal letterThink of a datagram like a postal letter You drop it in the mailbox and it arrives at its You drop it in the mailbox and it arrives at its

destinationdestination It could have taken any of several destinations to get It could have taken any of several destinations to get

there,…there,… But figuring that out is not your problemBut figuring that out is not your problem Imagine sending several letters to the same Imagine sending several letters to the same

destinationdestination They all arrive, but…They all arrive, but… They may have taken different routes to get thereThey may have taken different routes to get there

Network LayerNetwork LayerConnectionless ServiceConnectionless Service Imagine that the transport layer (a process) in host H1 Imagine that the transport layer (a process) in host H1

has a message to send to host H2, and,…has a message to send to host H2, and,… … … it is a big message – 4 times the max packet sizeit is a big message – 4 times the max packet size The network layer takes the message and breaks into The network layer takes the message and breaks into

4 packets, and sends it…4 packets, and sends it…

Network LayerNetwork LayerConnectionless ServiceConnectionless Service

From: Tanenbaum, 2003, pg. 346

Network LayerNetwork LayerConnectionless ServiceConnectionless Service Note: each packet can take a different routeNote: each packet can take a different route Route decisions are made by the routers…Route decisions are made by the routers… On packet by packet basisOn packet by packet basis Route decisions are made based on route tables Route decisions are made based on route tables

located in each routelocated in each route Route table does not tell exact how to get to the Route table does not tell exact how to get to the

destination, but which direction (which router port, or destination, but which direction (which router port, or connection link)connection link)

Network LayerNetwork LayerConnectionless ServiceConnectionless Service

From: Tanenbaum, 2003, pg. 346

Each router has its own tableEach table entry says for a given destination address – send the packet out on this portSo, in router A, a packet with a destination of F is sent to port C (like to router C) .. At least initiallyRouter C gets the packet, see that it is destined for F sends it out on port ENotice that router A’s route table changes so that packets headed for F get sent to B (rather than C)

Network LayerNetwork LayerConnectionless ServiceConnectionless Service

Routers can change their route tablesRouters can change their route tables Routers’s job to maximize the flow of packetsRouters’s job to maximize the flow of packets May change route tables becauseMay change route tables because

Link downLink down

Congested linkCongested link

……

Router decisions and route table updates are Router decisions and route table updates are Routing AlgorithmsRouting Algorithms

Routing Algorithms - complex topicRouting Algorithms - complex topic

We will look at Routing Algorithms in more detailWe will look at Routing Algorithms in more detail

Network LayerNetwork LayerConnectionless ServiceConnectionless Service

By the way, this is the way IP routing worksBy the way, this is the way IP routing works

Network LayerNetwork LayerConnection-Oriented ServiceConnection-Oriented Service Route through network established before packets Route through network established before packets

flowflow Fixed routeFixed route Once defined all packets flow through the same routeOnce defined all packets flow through the same route Referred to as a Referred to as a Virtual CircuitVirtual Circuit When a sending host wants to send a packet…When a sending host wants to send a packet… The network first sends a setup packetThe network first sends a setup packet The setup packet finds a path and …The setup packet finds a path and … Make forwarding table entries along the pathMake forwarding table entries along the path

Network LayerNetwork LayerConnection-Oriented ServiceConnection-Oriented Service Virtual Circuit has a connection IDVirtual Circuit has a connection ID Once a packet is assigned a connection ID (a label) it Once a packet is assigned a connection ID (a label) it

no longer needs a destination addressno longer needs a destination address Packet follows the virtual circuit, …Packet follows the virtual circuit, … ……not routed by destination addressnot routed by destination address Sort of like a phone call – once you are talking the Sort of like a phone call – once you are talking the

other person, you don’t need their phone number to other person, you don’t need their phone number to continue the conversationcontinue the conversation

When the packet stream is finished, the connection is When the packet stream is finished, the connection is released, and ….released, and ….

The virtual circuit is torn-downThe virtual circuit is torn-down

Network LayerNetwork LayerConnection-Oriented ServiceConnection-Oriented Service

From: Tanenbaum (2003), pg 348

Network LayerNetwork LayerConnection-Oriented ServiceConnection-Oriented Service Once the circuit is know the virtual circuit label is Once the circuit is know the virtual circuit label is

added to the packetadded to the packet Virtual circuit labels are per hopVirtual circuit labels are per hop ……that is, the label in a packet can be changed by the that is, the label in a packet can be changed by the

routers along the routerouters along the route

Network LayerNetwork LayerConnection-Oriented ServiceConnection-Oriented Service In the previous diagram, H1, then H3 initiate the flow In the previous diagram, H1, then H3 initiate the flow

of packets.of packets. H1 establishes VC 1, so it VC label is 1H1 establishes VC 1, so it VC label is 1 H3 starts a flow of packets, H3 starts a flow of packets, ……and since it is coorinating with H1, it assigns the VC and since it is coorinating with H1, it assigns the VC

with label 1…with label 1… But Router A recognizes that VC 1 belongs to another But Router A recognizes that VC 1 belongs to another

packet flow,…sopacket flow,…so It renames the VC as 2, It renames the VC as 2, From A to the destination then that VC is VC 2…From A to the destination then that VC is VC 2…

Network LayerNetwork LayerConnection-Oriented ServiceConnection-Oriented Service So, at A the router removes the VC label from the So, at A the router removes the VC label from the

connection Id field of the packet header, and…connection Id field of the packet header, and… ……replaces it the new VC number (2, in this example)replaces it the new VC number (2, in this example)

Replacing a label in route is called “label switch”Replacing a label in route is called “label switch” We will talk about this more laterWe will talk about this more later

Network LayerNetwork Layer

Network LayerNetwork LayerSo, how do they compareSo, how do they compare Connectless vs. Connection-Oriented ServiceConnectless vs. Connection-Oriented Service Datagrams vs. Virtual CircuitsDatagrams vs. Virtual Circuits

Datagrams must carry full source and Datagrams must carry full source and destination addressesdestination addresses

VC packets only carry the VC LabelVC packets only carry the VC Label

Datagram addresses must be parse and Datagram addresses must be parse and translated at each hoptranslated at each hop

VC packet label simply used as a lookupVC packet label simply used as a lookup

Network LayerNetwork LayerSo, how do they compareSo, how do they compare Connectionless service requires no setupConnectionless service requires no setup

Send a datagram and the routers will help it find its Send a datagram and the routers will help it find its wayway

No pretransmission overheadNo pretransmission overhead

Overhead per packetOverhead per packet Connection-Oriented Services requires the Connection-Oriented Services requires the

VC to be setup before packet flowVC to be setup before packet flowSetup packet sent first to establish VCSetup packet sent first to establish VC

For short transactions – a packet or two – For short transactions – a packet or two – connection-oriented service very expensiveconnection-oriented service very expensive

Network LayerNetwork LayerSo, how do they compareSo, how do they compare

Resilency to failure - router failure, line failureResilency to failure - router failure, line failure Connectionless – good, basically doesn’t careConnectionless – good, basically doesn’t care

Not a problem – routers find a different routeNot a problem – routers find a different route Connection Oriented – big problemConnection Oriented – big problem

VC torn down, packet flow lostVC torn down, packet flow lost

New VC must be established be transmission restartedNew VC must be established be transmission restarted

Network LayerNetwork LayerSo, how do they compareSo, how do they compare

Quality of ServiceQuality of Service Connectionless ServiceConnectionless Service

None, difficult, maybeNone, difficult, maybe

Connectionless – best availableConnectionless – best available Connection-Oriented ServiceConnection-Oriented Service

Good, easy to establishGood, easy to establish

Resources can be reserved when VC is setupResources can be reserved when VC is setup

Network LayerNetwork LayerSo, how do they compareSo, how do they compare

Traffic load, congestion handlingTraffic load, congestion handling Connectionless ServiceConnectionless Service

Not much, sort ofNot much, sort of Connection-OrientedConnection-Oriented

Easy, reliableEasy, reliable

Reserve resources (bandwidth) at VC setupReserve resources (bandwidth) at VC setup