+ All Categories
Home > Documents > Network Layer

Network Layer

Date post: 22-Oct-2014
Category:
Upload: kevin-panuelos
View: 343 times
Download: 0 times
Share this document with a friend
Description:
Notes about the Network Layer, based upon Tanenbaum's Computer Networks book. The last page of terms come from Wikipedia though. May receive an update in the future.
Popular Tags:
22
Network Layer - packets go to destination! - go around routers - must know topology of communication subnet (ie, all routers) - trace a path along the topology - If source and destination are in different networks, deal with them! Design Issues Store and Forward Packet Switching Carrier equipment belong in the circle composed of connected routers Customer equipment outside the oval connects via a line that is leased (H1), as well as a customer-owned LAN (H2) All these routers belong to one subnet. Sent packet goes through the routers one by one. (Store and forward packet switching) Packet is stored on the nearest router until it has finally arrived so the checksum can be verified. Packet is forwarded to the next router in the path until destination is reached Services to Transport Layer Two sides to implementation The Internet’s side (Connectionless) - subnet is unreliable so connectionless service is available (SEND PACKET, RECEIVE PACKET primitives) - no packet ordering and flow control - each packet must carry full destination address The telecom’s side (Connection-oriented) - reliable subnet because of experience with telephone system - quality of service - Asynchronous transfer mode Connectionless - packets are injected into the subnet individually and routed independently of each other - datagrams are the packets and they are sent through the datagram subnet Connection-Oriented Notes compiled by @kmp091 . Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)
Transcript
Page 1: Network Layer

Network Layer- packets go to destination!- go around routers- must know topology of communication subnet (ie, all routers)- trace a path along the topology- If source and destination are in different networks, deal with them!

Design IssuesStore and Forward Packet Switching

Carrier equipment belong in the circle composed of connected routersCustomer equipment outside the oval connects via a line that is leased (H1), as well as a customer-owned LAN (H2)

All these routers belong to one subnet.

Sent packet goes through the routers one by one. (Store and forward packet switching)• Packet is stored on the nearest router until it has finally arrived so the checksum can be

verified.• Packet is forwarded to the next router in the path until destination is reached

Services to Transport LayerTwo sides to implementationThe Internet’s side (Connectionless)- subnet is unreliable so connectionless service is available (SEND PACKET, RECEIVE

PACKET primitives)- no packet ordering and flow control- each packet must carry full destination address

The telecom’s side (Connection-oriented)- reliable subnet because of experience with telephone system- quality of service- Asynchronous transfer mode

Connectionless- packets are injected into the subnet individually and routed independently of each other- datagrams are the packets and they are sent through the datagram subnet

Connection-OrientedNotes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 2: Network Layer

- path from source to destination router must be established before any data packets can be sent

- virtual circuit describes this connection between source and destination routers, with a virtual-circuit subnet

Datagram subnet routing- a message is handed from a process and is preprended a header in the transport layer

(probably via an operating system procedure)- if a message is longer than the max packet size, the network layer has to break it down

and send each part to the subnet using a point-to-point protocol- Once the message enters the subnet, the carrier takes over the transportation; each

router has an internal table telling it where to send packets for each possible destination, and each entry in the table consists of a destination and the outgoing line to use for that destination

- routing algorithm manages tables and makes the routing decisions

Virtual circuit subnet routing- virtual circuits avoid having to choose a new route for every packet sent; only one route is

used for all traffic flowing over the connection

Comparison of datagram and virtual-circuit subnets

Datagram or VC? It all comes down to:a) router memory space and bandwidth

Virtual circuit - packets contain circuit numbers instead of full destination addresses* Full destination addresses in every packet may represent overhead* However, circuit numbers have a weakness when it comes to table space within the

routers

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 3: Network Layer

b) setup time versus address parsing timevirtual circuit setup phase takes time and consumes resources, but searching for the circuit number (that corresponds to a table index) is easy; datagram subnet lookup procedure is more complicated

c) table space in router memorydatagram subnet requires an entry for every possible destination, whereas virtual circuit subnet requires an entry for each virtual circuit

* Virtual circuits reserve resources in advance, assuring reliability* Datagram subnet can congest, and can be difficult to avoid

* Virtual circuits are vulnerable in the sense that if a router crashes and turns on the next second, everything transferred is lost.

* Datagram routers that go down only lose the data in them, not the entire thing

Routing Algorithms- part of the network layer software responsible for deciding which output line an incoming

packet should be transmitted on- for datagrams, decision to route is made all the time- for virtual circuits, routing decision is made when a new virtual circuit is being set up (so

path won’t change even if a more optimal path appears) (session routing)

routing versus forwardingforwarding - what happens when a packet arrives; look up the outgoing line to use for it in the routing tablesrouting - make the decision which routes to use; update and fill in the routing tables where the packet will be forwarded

design goals for algorithms- correctness- simplicity- robustness - network runs for years and copes for changes in technology and topology

(not hardware dependent)- stability- fairness- optimality

kinds of algorithms- nonadaptive

choice of route is computed in advance, off-line and downloaded to routers when the network is booted (static routing)

- adaptiverouting decisions change when topology and traffic changes; have differing data sources, route change operations, optimization metrics (dynamic routing)

The Optimality Principle- one can make a general statement about optimal routes without regard to topology or

traffic- if a router J is on the optimal path from router I to router K, then the optimal path from J to

K also falls along the same route

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 4: Network Layer

sink tree - set of optimal routes from all sources to a given destination form a tree rooted at the destination; the distance is measured in hops

sink tree qualities- no loops (so packets are delivered in a finite and bounded number of hops)- different routers may go down and come back up during operation, so different routers

may have different ideas about the current topology- benchmarks routing algorithms

Shortest Path Routing- build a graph of the subnet, with each node of the graph representing a router and an arc

representing a communication line (or link); find the shortest path in the routers in the graph

- number of hops measure paths, distance in kilometers, or whatever- Other metrics besides hops and distance include transmission delay and mean queuing- Arc labels could have function of the distance, bandwidth, average traffic, communication

cost, mean queue length, measured delay and other factors

Djikstra’s algorithm- each node is labeled in parenthesis with its distance from the source node along the best

known path- no paths are known at first, so all nodes are labeled with infinity- algorithm proceeds to find paths, labels are changed reflecting better paths- label may be tentative or permanent- when the label is the shortest possible path from the source to that node, it is made

permanent and is never changed

Flooding- static algorithm where every incoming packet is sent out on every outgoing line except

the one it arrived on- duplicate packets are sent out- “Dam the effects of flooding

- hop counter contained in the header of each packet can be used to dampen the effects of flooding (decrement every hop)

- take which packets have been flooded, to avoid sending them out a second time- selective flooding: routers do not send every incoming packet out on every line, only on

those lines that are going approximately in the right direction- not practical, but useful for military applications and distributed database applications or

wireless networks

Distance Vector routing- each router maintains a table (or vector) that gives the best known distance to each

destination and which line to use to get there- neighbors exchange information with a router to update the tables- Bellman Ford or Ford-Fulkerson algorithms; original ARPANET routing algorithm- each router maintains a routing table indexed by each router in the subnet

- an entry contains:- preferred outgoing line to use for destination- estimate of time/distance to that destination

- Metrics could be hops, time delay, packets queued along path, etc.- Router is assumed to know the “distance” to each of tis neighborsNotes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 5: Network Layer

- If metric is in hops, distance is just one hop- If metric is queue length, router examines each queue- If metric is delay, router sends out special ECHO packets that the receiver

timestamps and sends back

Count to Infinity problem- distance vector routing may converge slowly- “good news” propagates fast, “bad news” slowly- when a router is cut off from the subnet, the direct neighbor gets wind of it, but not the

rest of the routers

A B C DB C D

- say A was cut off and B knows about it- however when C shares its vector, it has a connection to A, so B thinks A is

connected to C and updates its vector entry- this vector entry is added until it reaches infinity (convergence), which tends to be

a really long time

Link state routing- bandwidth was taken into account- each router must do the following:

- discover neighbors and learn their network addresses- measure delay or cost to each of its neighbors- construct a packet telling all it has just learned- send this packet to all other routers- compute shortest path to every other router

- Complete topology and all delays are measured and distributed to all routers, then Djikstra’s algorithm is used to find the shortest path to every router

Learning about neighbors - Send a special HELLO packet on each point-to-point line

Measuring line cost - reasonable estimate of delay to each of its neighbors using an ECHO packet that the other side will receive and send back; measure round trip and divide by twoNotes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 6: Network Layer

- but an attractive line may be bothered by many requests since it’s optimal- factoring in the traffic will make other routes more attractive

Building link state packets - build a packet containing all data! - packet contains sender identity, sequence number and age, and a list of neighbors! - list of neighbors contains delay

- packets are built either periodically (regular intervals) or during an event (neighbor goes down or comes back up again)

Distributing link state packets - reliable distribution is tricky- routers getting the first packets change their routes- different routers may be using different versions of the topology, which can lead to

inconsistencies, loops, unreachable machines and other problems

! Basic distribution algorithm:- use flooding to distribute link state packets- each packet contains a sequence number incremented for each new packet sent- routers track (source router, sequence) pairs they see- new link state packets are checked against the list of seen packets- new link state packets that pass the check are forwarded on all lines except the

one it arrived on- duplicates are discarded

! Problems:- router crashing = lost packets; resending these packets will not be possible

because of the check- corrupted sequence number will lead to rejection of packet numbers in between

(eg, packets 1-65 are transmitted, 1 is received, and then 65 is received, so 2-64 are invalidated and considered obsolete)

! Solutions:- include the age of each packet after the sequence number and decrement once

per second- zero age = discarded information

Adjustments for Robustness:- when a link state packet comes in to a router for flooding, it is not queued for

transmission immediately- packet is held for a while until another link state packet from the same source

comes in; both packets are compared (specifically their sequence numbers) and if they are equal, the duplicate is discarded; if they are different, the older one is thrown out

Computing new routes- if link state packets have been accumulated by a router, it can construct the entire subnet

graph because every link is represented- Djikstra’s algorithm is run to construct shortest path to all possible destinations- routing tables get the results of the algorithm and normal operation is resumed- software and hardware problems can wreak havoc with the algorithm, leading to

inaccurate depictions of the subnet

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 7: Network Layer

Protocols- Intermediate System-Intermediate System

- adopted by ISO for its connectionless network layer protocol CLNP and made for DECnet

- router topology is distributed, from which shortest paths are computed- supports multiple network layer protocols at the same time- innovations were adopted by OSPF including flooding link state updates,

designated router on a LAN, method of computing and supporting path splitting and multiple metrics

Hierarchical Routing- growth of routing tables- more CPU is required to scan big routing tables- divide the routers into regions, with each router knowing the details about how to route

packets to destinations within its own region, but knowing nothing about the internal structure of other regions

- several levels of hierarchy: regions > clusters > zones > groups > etc.- Penalty is increased path length

Broadcast Routing- hosts send messages to many or all other hosts- send a packet to all destinations simultaneously (broadcasting)- Methods:

- send a distinct packet to each destination (wasteful)- flooding (but it generates too many packets and consumes too much bandwidth)- multidestination routing

- each packet contains a list of destinations or a bit map indicating desired destinations

- all destinations are checked to determine output lines needed- router generates a new copy of the packet for each output line to be used

and includes in each packet only destinations that are to use the line- destination is partitioned among output lines

- spanning tree- sink tree is used to initiate broadcast- subset of subnet that includes all the routers but contains no loops- excellent bandwidth use- spanning tree is only available with link state routing, not distance vector

routing- reverse path forwarding

- broadcast packet arrives at a router, and a router checks to see if the packet arrived on the line normally used to send packets to the source of the broadcast

- if so, the broadcast packet must’ve followed the best route from the router and is the first copy to arrive at the router (so the router transmits it to all its neighbors except the source router)

- efficient and easy to implement- routers need not know about spanning trees nor keep a destination list

- multicast routing- large groups aren’t made for point-to-point- sending a message to a big group is called multicasting, and the routing

algorithm is multicast routingNotes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 8: Network Layer

* Multicasting - requires group management (create, destroy, join, leave)- Multicast routing involves spanning tree covering all other routers

- a multicast packet is sent to a group- first router examines spanning tree and prunes it, removing lines that do not

lead to hosts that are members of the group- Link state routing - spanning tree is pruned starting at the end of

each path, working toward the root and removing all routers that do not belong to the group

- Distance vector routing - reverse path forwarding; sends PRUNE message, telling the sender not to send it any more multicasts for that group

- does not scale to large networks well- core based trees: alternative design where spanning tree is created per

group, with the root (core) near the middle of the group- host sends packet to core, then does the multicast along the

spanning tree

- Routing for mobile hosts- to route a packet to a mobile host, the network has to find it- roaming hosts: compute on the run and wait to maintain their connections

as they move around- foreign agents - processes that keep track of mobile hosts visiting the area- home agent - keeps track of hosts whose home is in the area, but are

visiting another area- when a new host enters an area, the computer must register itself with the

foreign area there:- each foreign agent broadcasts a packet announcing its existence

and address- the mobile host registers with the foreign agent, giving its home

address, current data link layer address, and some security info- foreign agent contacts mobile host’s home agent and sends foreign

agent’s network address and security info- The home agent examines the security information, which has a

timestamp, to prove that it was generated within the past few seconds

- When the foreign agent gets acknowledgment from the home agent, it makes an entry in its tables and informs the mobile host that it is now registered

- host must allow deregistration when users turn off their computers- home agent encapsulates packet into the payload field of an outer packet

and sends it to the foreign agent (tunneling)- foreign agent removes the original packet from the payload and sends it to

the mobile host as a data link frame!

- Routing in Ad hoc networks- routers are mobile- each node consists of a router and a host on the same computer- networks of nodes near each other are ad hoc networks or MANETs

(mobile ad hoc networks)- routers can come and go or appear in new places at the drop of a bit- topology may change all the time, so paths change spontaneously

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 9: Network Layer

- AODV (Ad hoc on-demand distance vector) routing algorithm

! ! Route discovery- ad hoc network can be described by a graph of the nodes- two nodes are connected if they can communicate directly using their

radios- AODV algorithm maintains a table at each node, keyed by destination,

giving information about that destination, including which neighbor to send packets to in order to reach the destination

- Example, node A looks at its table and does not find an entry for node I, to which it wants to send a packet. A now has to find a route to I. The property of discovering routes only when needed makes the algorithm “on demand”

- To find a node, a special ROUTE REQUEST packet is broadcasted- ROUTE REQUEST contains source and destination

addresses (IP addresses) and request ID (local counter that is incremented each time a ROUTE REQUEST is broadcast)

- Source address and Request ID fields uniquely identify ROUTE REQUEST packet to allow nodes to discard duplicates

- format of ROUTE REQUEST packet

- second sequence counter is incremented when a ROUTE REQUEST is sent to act like a clock (tells old routes from new routes)

- Source sequence # is the sequence counter- Destination sequence # is the most recent value of I’s sequence

number that A has seen (0 if never seen)- Hop count counts how many hops that packet has made (initialized

to 0)

! PROCESSING a ROUTE REQUEST1) (source address, request ID) pair is looked up to see if the request

has already been seen and processed; duplicates are discarded, otherwise the pair is entered into the history table

2) receiver looks up destination in its route table; ROUTE REPLY packet is sent back to the source if a new route is known and that route is greater than or equal to the Destination sequence number in the ROUTE REQUEST packet

! ! ! ! - less means older, so proceed to step 33) increment Hop count field and rebroadcast ROUTE REQUEST

packet; extract data from the packet and store it in a reverse route table (for the use of the reply, which goes back to the source)

ROUTE REPLY1) destination node builds a ROUTE REPLY packet

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 10: Network Layer

2) Source, destination, hop count are copied from incoming request, but destination sequence # is taken from the destination node’s own counter, and the hop count field is set to 0. Lifetime controls how long the route is valid

3) This packet is unicast to the node where the ROUTE REQUEST packet came from then follows the reverse path to the source (while incrementing Hop count)

4) REPLY is inspected with each node in the middle1) the nodes in the middle must not know the route to

destination node I2) Sequence number for I in the ROUTE REPLY packet is

greater than the value in the routing table3) The sequence numbers are equal but the new route is

shorter

Route Maintenance- There is a need to adapt to simultaneously changing topology- Hello message is broadcast and neighbors must respond to it; if no

response is received the neighbor is out of range- This info purges routes that no longer work

- for each possible destination, each node N keeps track of its neighbors that have fed it a packet for that destination during the last few seconds

- N’s active neighbors for that destination respond to the Hello packet

- They are kept in a table keyed by destination and containing the outgoing node to use to reach the destination, the hop count to the destination, the most recent destination sequence number, and the list of active neighbors for that destination

- Unreachable neighbors of N are considered when checking routing table; for each route, the active neighbors are informed that any routes via N is invalid and must be purged (this happens recursively)

- Nodes do not send periodic broadcasts containing the entire routing table (unlike Bellman-Ford)

- AODV also does broadcast and multicast routing

Node lookup in peer-to-peer networks- distributed systems where nodes are symmetric and there is no central control of

hierarchy- users with information that is of interest to other users is shared in the absence of a

centralized database or index- solving this problem are algorithms like the Chord algorithm

- consists of n participating users- each user has records shared in bits and pieces of the index for use by other

users- each user node has an IP address that is hashed into a node identifier- node identifiers are arranged in ascending order in a big circle and successors are

determined in a clockwise manner (among active nodes)- the key is made from the names of the records, and are indexed with nodes that

have similar names

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 11: Network Layer

- finger tables speed up the search, where each entry points to a different actual node

- search (lookup of key at node k): if key falls between k and the successor of k, then the node holding information about key is the successor, then the search terminates; otherwise, the finger table is searched to find the entry whose start field is the closest predecessor of key

- successor must be recomputed to update finger tables- distributed filesystems have been made through Chord- Pastry and Freenet are other peer to peer systems

Congestion Control Algorithms- too many packets in a part of a subnet = congestion- caused by

1) stream of packets arriving on three or four input lines and all need the same output line, building up a queue2) larger memory won’t be able to help in the long term, for duplicates will have been sent, making congestion worse3) slow processors and mismatch between parts of a system

- congestion control makes sure that the subnet is able to carry the offered traffic, and is a global issue involving all hosts, routers, and the store-and-forwarding processing between routers

- flow control in contrast is only concerned with point-to-point traffic between sender and receiver

General principles> Divide solutions into open loop and closed loop

Open loop: good design (doesn’t occur in the first place)- once system is up, no midcourse corrections are made- tools include deciding when to accept new traffic, deciding when to discard

packets and which ones, and making scheduling decisions at various points in the network

- decisions are made with no regard to the current state of the network

Closed loop: based on feedback loopa) monitor the system to detect when and where congestion occursb) pass information to places where action can be takenc) adjust system operation to correct the problem

Metrics to monitor subnet for congestion:1) percentage of all packets discarded for lack of buffer space2) average queue lengths3) number of packets that time out and are retransmitted4) average packet delay5) standard deviation of packet delay

Transfer information about congestion from the point where it is detected to the point where something can be done about it:- send a packet to the traffic source or sources, announcing the problem- extra packets increase the load when less load is needed (congestion)

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 12: Network Layer

A bit or field can also be reserved in every packet for routers to fill when congestion goes above threshold. Router detects this and warns neighbors

Probe packets can also be sent to explicitly ask about congestion to route traffic around problem areas

Knowledge of congestion will then be utilized to solve it: adjust time scale to an average (not too short, not too long)

Congestion control algorithm taxonomy:1) open loop

1) acts at source2) acts at destination

2) closed loop1) explicit feedback - packets sent back from point of congestion to warn

source2) implicit feedback - source deduces congestion by making observations

(eg, time needed for acknowledgments to come back)

Congestion handling in Virtual circuits (Network Layer)a) Congestion prevention policies

Open loop systems are designed to minimize congestion in the first place rather than letting it happening then reacting to it.

Data Link Layer- Retransmission policy: how fast sender times out and what it transmits upon timeout- Buffering policy: receivers discard out of order packets, packets will have to be transmitted again creating extra load (selective repeat is better than go back N in congestion control)- Acknowledgment policy: immediate acknowledgment of packets generate extra traffic; saved up acknowledgments may result in extra timeouts and retransmissions; tight flow control scheme reduces data rate and fights congestion

Network Layer- VC or Datagrams: most congestion control algos are designed for VCs- packet queueing and service policy: routers have one queue per input line, one queue per output line, or both

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 13: Network Layer

- Order packets are processed: round robin? Priority?- Discard policy: which packet is dropped when there is no space- Routing algorithm: spread traffic over all lines- packet lifetime management: how long a packet may live before being discarded; too long = clogging, too short = time out before destination is reached thus inducing retransmission

Transport Layer- same issues as data link layer- determining timeout interval is harder (network travel is less predictable)

b) Dynamic congestion control- admission control: once congestion has been signaled, no more virtual circuits are set up until the problem has gone away- redraw the entire subnet to omit the congested part

- another way is to negotiate an agreement between the host and subnet when a virtual circuit is set up- agreement specifies volume and shape of traffic, quality of service and other parameters- subnet reserves resources along the path when the circuit is set up, including table and buffer space in the routers and bandwidth on the lines- congestion is unlikely to occur on the new virtual circuits because all the necessary resources are guaranteed to be available- however this is wasteful on resources

Datagram congestion algorithms are handled in the Transport layer

u - utilizationf - either 0 or 1a - constant determining how fast router forgets recent history

newly arriving packets check to see if the output line is in a warning state; if it is, action is taken:

The Warning Bit- set a special bit in the packet’s header- transmission rate is adjusted if acknowledgments flow in- slower acknowledgments = increase the transmission rate! (but only if no router is

in trouble)

Choke Packets- router sends choke packet back to the source host, giving it the destination found in the packet- original packet is tagged (header) so that it will not generate any more choke packets farther along the path and is then forwarded in the usual way- when source host gets choke packet, it reduces traffic to the destination by a percentage- host should ignore choke packets to the destination for a fixed time interval and then listen to them again

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 14: Network Layer

Hop by hop choke packets- sending a choke packet to the source host is slow- choke packet should take effect at every hop- provide quick relief at the point of congestion at the price of using up more buffers upstream (congestion is nipped in the bud without losing any packets)

Load Shedding- when routers are busy with packets they can’t handle, throw them away- sort of like intentionally blacking out areas to save the entire grid from collapsing- router can randomly pick packets to drop, or drop newer packets (for data) or older

packets (for multimedia); the former is called wine, the latter milk.- intelligent discard policy: applications mark their packets in priority classes to indicate

how important they are; routers can first drop packets from the lowest class, then the next lowest, and so on

- high priority packets can be sent under light load, and discarded on heavy load

Random Early Detection- disregard packets before all buffer space is exhausted- Random early detection slows down the source (because TCP was designed for wired

networks which are reliable) by having routers drop packets before the situation becomes hopeless

Jitter Control- in audio/video streams, it doesn’t matter how long the stream takes to load as long as the

transit time is constant- variation in packet arrival times is jitter

- high jitter: uneven quality, huge delay in delivering packets- low jitter: little delay

- jitter can be bounded by computing expected transit time for each hop along the path- when a packet arrives at a router, the router checks if the packet is behind or

ahead of schedule- information is stored in the packet and updated at each hop- if packet is ahead of schedule, it is held for a while until everything’s on schedule;

otherwise, the router tries to get it out of the way ASAP- VOD buffers, videoconferencing requires real-time

Quality of Serviceflow - stream of packets from a source to a destinationconnection-oriented - packets belonging to a flow follow the same routeconnectionless - follow diff. routes

* needs of each flow are characterized by reliability, delay, jitter and bandwidth (they determine Quality of Service)

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 15: Network Layer

reliability - no bits should be incorrectly delivered; checksum each packet and verify the checksum at the destinationdelay - uniform delay by a few seconds is harmless; interactive applications (surfing and login) are more delay sensitive; telephony and real-time have strict delay requirementsjitter - audio and video are not very good when there’s jitterbandwidth - video needs this a lot

ATM classify flows in four broad categories with respect to their Quality of service demands:1) constant bit rate - simulates a wire by providing uniform bandwidth and delay2) real time variable bit rate - when video is compressed, some frames more compressed

than others (videoconferencing)3) non real time variable bit rate - watching a movie over the internet4) available bit rate - file transfer

Achieve Quality of Service1) Overprovisioning - provide a lot of resources and let the packets fly; expensive2) Buffering - flows can be buffered on the receiving side before being delivered; doesn’t

affect reliability or bandwidth and increases delay but smooths out jitter; helps with video and audio

3) Traffic Shaping - smooths out traffic on server side by regulating the average rate and burstiness of data transmission; reduces congestion and uses service level agreements to deliver things in a timely fashion, especially if the customer and provider agree on the way the data is deliveredservice level agreement - connection is set up, user and subnet agree on a certain traffic pattern for a circuittraffic policing - monitor traffic flow

4) Leaky Bucket5) Token Bucket6) Resource Reservation7) Admission Control8) Proportional Routing9) Packet Scheduling - similar to process scheduling in OS

The Leaky Bucket AlgorithmNo matter the rate at which water enters the bucket, the outflow is at a constant rate (p) when there is any water in the bucket and 0 if the bucket’s empty; Once the bucket’s full, additional water spills over the sides and is lost

In packet speak, each host is connected to the network by an interface containing a “leaky bucket” (finite internal queue). If a packet arrives at the queue when it is full, the packet is discarded. Proposed by Turner (1986).Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 16: Network Layer

One packet per clock tick is put onto the network; can be enforced by interface card or operating system. Uneven flow of packets from the user processes inside the host is turned into an even flow of packets onto the network, smoothing bursts and reducing congestion.

Same sized packets - this works well.Variable sized packets - allow a fixed number of bytes per tick rather than one packet to work well.

1024 bytes per tick, or 2 512 byte packets, or 4 256 byte packets, etc. If residual byte count is too low, next packet must wait until the next tick

The Token Bucket Algorithmleaky bucket holds tokens, generated by a clock at the rate of one token every few seconds. For a packet to be transmitted, it must capture and destroy one token.

Token bucket algorithm allows saving up of requests (up to the maximum bucket size) which allows bursts of up to the maximum bucket size at one time, allowing some burstiness in the output stream and faster response to sudden bursts of input

Token bucket throws away tokens when the bucket fills up but never discards packets

Minor variant: A packet is only transmitted if enough tokens are available to cover the length in bytes. Fractional tokens are kept for future use.

Can smooth traffic between routers and regulate host output. However, token bucket regulating a host can stop the host from sending when the rules say it must. Telling a router to stop sending while its input keeps pouring in may result in lost data.

Calculate the maximum rate burst:burst length - S sectoken bucket capacity - C bytestoken arrival rate - p bytes/secmaximum output rate - M bytes/sec

output burst contains a max of C + pS bytesNumber of bytes in a maximum speed burst of length S seconds in MSThus, C + pS = MS

Smoother traffic - insert a leaky bucket after a token bucket

Resource Reservation- regulate the shape of ordered traffic = guarantee quality of service- effectively using the information implicitly = all packets of a flow must follow the same

route- specific route for a flow ensures reservation of resources along that route to make sure

needed capacity is available- different reservable resources:

1) bandwidth - transmission capacity2) buffer space - when a packet arrives, it is deposited on the network interface card by

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 17: Network Layer

the hardware; router software then has to copy it to a buffer in RAM and queue that buffer for transmission on the chose outgoing line; if no buffer is available, the packet has to be discarded since there is no place to put it3) CPU cycles - scarce; router processes a packet within a given amount of CPU time; CPU must not be overloaded to ensure timely processing

Admission ControlWays to implement in routing algorithms:1) Don’t allow new Virtual Circuits2) Allow new Virtual Circuits but route all new Virtual Circuits around problem areas3) Negotiate an agreement before the Virtual Circuit is set - flow control comes into the

equation

In admission control, many parties are involved in flow negotiation. As such, flows must be described accurately in terms of specific parameters that can be negotiated (flow specification). The sender produces a flow specification, and every intermediate router gets to modify the parameters if needed. The modifications can reduce the flow, not increase it (eg., lower data rate, not higher) and when it gets to the destination, the parameters can be established.

eg,! The second parameter is the size of the bucket in bytes. If, for example, the Token bucket rate is 1 Mbps and the Token bucket size is 500 KB, the bucket can fill continuously for 4 sec before it fills up (in the absence of any transmissions). Any tokens sent after that are lost.

Proportional Routing

Usual behavior: Best path for each destination is determined and all traffic is sent to that destination over the best path

Different approach: Split the traffic over multiple paths by using locally available information (divide traffic in proportion to the capacity of the outgoing links or equally)

Packet schedulingPackets processed in order of arrival = potential starvation for smaller flows when larger flows comes first

• fair queueing algorithm - routers have separate queues for each output line, one for each flow- when a line becomes idle, the router scans the queues round robin, taking the first packet on the next queue- n hosts competing for the same output line each get to send one out of every n packets- gives all hosts the same priority

• weighted fair queueing

Integrated services- research for architecture for streaming multimedia resulted in two RFCs: flow-based

algorithms or integrated services for unicast and multicast applications.

RSVP – Resource reSerVation ProtocolNotes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 18: Network Layer

- main IETF protocol for integrated services architecture- makes reservations- allows multiple senders to transmit to multiple groups of receivers, permits individual

receivers to switch channels freely and optimizes bandwidth use while eliminating congestion

- Uses multicast routing using spanning trees- Each group has an address; this address is placed in the packets to be sent to the group

members in the spanning tree to be formed by the routing algorithm- Upon reservation, the message is propagated using the reverse path forwarding

algorithm, and each router in the spanning tree reserves the necessary bandwidth (if there is not enough bandwidth, back failure is reported)

Differentiated services- flow-based algorithms require advance setup (this doesn’t scale well) and are vulnerable

to router crashes, so the IETF devised an approach that didn’t require advance setup called classed based quality of service

- differentiated services are a set of service classes with forwarding rules; packets may get Type of Service packets determining the kind of service provided to different classes

Expedited forwarding- goes through the subnet as if no other packets were present- regular vs. expedited

- two output queues for each outgoing line: one for expedited, one for regular packets, then use packet scheduling algorithm

Assured forwarding- service classes: four priority classes, each class having its own resources- discard probabilities for congestion control: low, medium and high

Label switching and MPLS- vendors added a label in front of each packet and did routing based on the label rather

than on the destination address- correct output line is a simple table lookup (although this is close to virtual circuits)- label switching and tag switching = MPLS (MultiProtocol Label Switching)- routing: look up a destination address in a table to find where to send it- switching: uses a label taken from a packet as an index into a forwarding table

- forwarding equivalence class: routers group multiple flows that end at a particular router or LAN and use a single label for them

- in MPLS, packets still contain their final destination address, and at the end of the labeled route, have the label header removed and continue forwarding as usual (using the network layer destination address)

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 19: Network Layer

- data driven forwarding table creation: when a packet arrives, the first router it hits contacts the router downstream where the router has to go and asks it to generate a label for the flow> colored threads - prevents loops (if color is present, pull back the colored thread into the subnet)

- control driven approach: when a router is booted, it checks to see for which routes it is the final destination, then creates one or more FECs for them, allocates a label for each one, and passes the labels to its neighbors (the labels are then stored in each router and propagated to neighbors until everyone has acquired the path)

InternetworkingTCP/IP - personal computersSNA - large business mainframesATM - telephone companiesNovell NCP/IPX or Appletalk - some personal computer LANs

how do you connect and interconnect these different protocols?they differ in:

> requires address conversions> differing quality of service> differing specifications, error, flow, congestion control

- in the physical layer, networks can be connected by repeaters or hubs (they do not understand digital protocols)

- multiprotocol router: router that handles multiple protocols

styles of internetworking:- concatenated virtual circuits

- a connection to a host in a distant network is set up similarly to how connections are normally established

- subnet builds a virtual circuit to the router nearest the destination network, and then it constructs a virtual circuit from that router to an external gateway (multiprotocol router)

- datagram- inject datagrams into the subnet and hope for the best

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 20: Network Layer

- achieves higher bandwidth than concatenated VC model

Problems:- incomplete conversions from one protocol to another- addressing problems- creation of a universal “internet” packet and have all routers recognize it (not all

companies want to accept a standard Internet protocol because they’ll profit from proprietary protocols)

Tunnelinga solution to the internetworking problem (source and destination hosts are on the same type of network, but a different network is in between)

eg,SOURCE: TCP/IP! ! ! MIDDLE PART: ATM ! ! DESTINATION: TCP/IP

a big tunnel can extend from one multiprotocol router to the other

Internetwork Routingconstruction of the graph of the various networks, and then using routing algorithms to the set of multiprotocol routers that connect the networks

two level routing algorithm:interior gateway protocol - routing within each networkexterior gateway protocol - routing between networks

Autonomous system - each network is independent of other networks, thus they are called this

internetwork routing is subject to international laws as opposed to intranetwork routing

Fragmentation- routers or gateways break up packets into fragments, sending each fragment as a

separate packet (but it’s hard to put the fragments together again)- this is to address problems posed by maximum packet lengths specified by routers

- one approach to putting packets back together is to give them the same exit gateway where the pieces are recombined (destination router looks for “end of packet” bit before recombination)

- another approach to putting packets back together is to refrain from recombining fragments at any intermediate gateways (broken packets are treated like original packets, recombination only happens at destination host)

- a numbering style akin to a tree can be used to ensure pieces can be correctly reassembled at the destination, no matter what order they arrive in; the disadvantage is that when a part of the packet is lost, the source retransmits the entire bigger packet again

Network Layer in the Internet1) make sure it works2) keep it simple - Occam’s razor3) make clear choices - choose one way of doing something4) exploit modularity - protocol stacksNotes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 21: Network Layer

5) expect heterogeneity - different hardware, transmission facilities, and applications occur, so network design must be simple, general and flexible

6) avoid static options and parameters - negotiate values rather than have fixed choices7) look for a good design - go for the good design and put the burden of working around

limitations to other people8) be strict when sending and tolerant when receiving - packets compliant with standards

are sent, incoming packets are not fully compliant so deal with them9) think scalability - load must be spread evenly across resources10)performance and cost

Internet protocol“ties everything together”

IP datagram is the format of the internet - has header and text parts

• version - protocol version• IHL - how long the header is• type of service - distinguishes classes of service• Precedence - 3 flag bits let host specify what it cared about most (Delay, Throughput,

Reliability)• Total length - everything in the datagram (header + data length)• Identification - allows destination host to determine which datagram a newly arrived

fragment belongs to (all fragments belong to the same identification value)

• DF - don’t fragment• MF - more fragments; all fragments except the last one have this bit set• fragment offset - current datagram where the fragment belongs• time to live - packet lifetimes• protocol - TCP, UDP, whatever (specification)• Header checksum - header verification; assumed to be zero upon arrival• Source and Destination address - indicate network number and host number• Options - provide way for subsequent versions of the protocol to include information not

present in the original design

IP AddressesNotes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)

Page 22: Network Layer

32 bits long and used in the source and destination address fields of IP packets• classful addressing• classless addressing

CIDR/CDR - Classless InterDomain Routing; used to slow down exhaustion of IPv4 addresses and slow down growth of router tables; allocates address space to Internet service providers and end users on any address bit boundary instead of 8 bit segmentsNAT - Network Address Translation; modify IP packet headers while in transit across a traffic routing device; alleviate IPv4 address exhaustion; enables multiple hosts on a private network to connect using a single IP addressPAT - Port Address Translation; alter TCP/UDP ports in outgoing communications and maintain translation table so return packets are correctly translated back (NAT provides an ambiguity since it enables multiple users to use a single IP address)ICMP - Internet Control Message Protocol; used by operating systems of networked computers to relay error messages (say, a service is unavailable or a server/host cannot be reached)ARP - Address Resolution Protocol; used for resolution of network addresses into link layer addressesRARP - Reverse Address Resolution Protocol; a host requests its IPv4 address from an administrative host when it has its MAC address or Link Layer addressDHCP - Dynamic Host Configuration Protocol; replacement for RARP; automates network-parameter assignment across several network devicesOSPF - Open Shortest Path First; widely-used interior gateway protocol that routes IP packets within a single routing domainBGP - Border Gateway Protocol; widely-used exterior gateway protocol; maintains a table of IP networks or ‘prefixes’ which designate network reachability among autonomous systems; used by internet providers to route with each other

Notes compiled by @kmp091. Based from Tanenbaum’s Computer Networks, with some information from Wikipedia (the last page)


Recommended