Docsity

Routing and Network Layer Protocols: A Comprehensive Guide, Summaries of Computer Systems Networking and Telecommunications

Toggle sidebar
bg1
Chapter 4 The Network Layer
In this chapter we will make an important distinction between forwarding and routing. Forwarding
is transferring a packet from an incoming link to an outgoing link within a single router. Routing
involves all of the network's routers, whose collective interactions determine the path that packets
take from source to destination. Routing is calculated via routing algorithms.
Every router has a forwarding table. A router forwards a packet by examining the value of a field
in the header and compares them to the values in his forwarding table with the corresponding
outgoing link. These forwarding tables are determined by the routing algorithms. There is a small
difference between link-layer switches and other switches. Link-layer switches base their
forwarding decision on values in the field of the link-layer frame. Other routers base it on values in
the network-layer field.
The network service model defines the characteristics of end-to-end transport between hosts.
There are three important network service models:
–Best-effort service: This is the Internet's service model. This model will try its best but can't
promise anything. It might appear that best-effort service could also be no-service-at-all but
there are reasons for such a minimal network layer service model.
–Constant Bit Rate (CBR) ATM network service: This network service tries to supply a
constant bandwidth for transmission. The send packets are guaranteed to arrive before a
certain delay.
–Available Bit Rate (ABR) ATM network service: This network service is considered the
slightly-better-than-best-effort- service. As the Internet's best-effort service, packets can get
lost. But unlike the Internet's best-effort service, packets cannot be reordered when shuffled
or lost and can assure a minimum cell transmission rate (MCR). We have previously
discussed how it can increase its sending rate.
4.2 Virtual Circuit and Datagram Networks
Just like how the transport layer can provide connectionless application service (UDP) and
connection-oriented application service (TCP), can the network layer also provide the two. There
are however some crucial differences:
–In the network layer we have services for end-to-end hosts. In the transport layer we have
services for application-to-application.
–Computer networks who provide a connection service is called a virtual-circuit (VCs).
Computer networks who provide a connectionless service is called a datagram network.
–Transport-layer connection-oriented services are implemented in end hosts. Network-layer
connection services are implemented in end hosts and routers.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Routing and Network Layer Protocols: A Comprehensive Guide and more Summaries Computer Systems Networking and Telecommunications in PDF only on Docsity!

Chapter 4 The Network Layer

In this chapter we will make an important distinction between forwarding and routing. Forwarding is transferring a packet from an incoming link to an outgoing link within a single router. Routing involves all of the network's routers, whose collective interactions determine the path that packets take from source to destination. Routing is calculated via routing algorithms. Every router has a forwarding table. A router forwards a packet by examining the value of a field in the header and compares them to the values in his forwarding table with the corresponding outgoing link. These forwarding tables are determined by the routing algorithms. There is a small difference between link-layer switches and other switches. Link-layer switches base their forwarding decision on values in the field of the link-layer frame. Other routers base it on values in the network-layer field. The network service model defines the characteristics of end-to-end transport between hosts. There are three important network service models:

  • Best-effort service: This is the Internet's service model. This model will try its best but can't promise anything. It might appear that best-effort service could also be no-service-at-all but there are reasons for such a minimal network layer service model.
  • Constant Bit Rate (CBR) ATM network service: This network service tries to supply a constant bandwidth for transmission. The send packets are guaranteed to arrive before a certain delay.
  • Available Bit Rate (ABR) ATM network service: This network service is considered the slightly-better-than-best-effort- service. As the Internet's best-effort service, packets can get lost. But unlike the Internet's best-effort service, packets cannot be reordered when shuffled or lost and can assure a minimum cell transmission rate (MCR). We have previously discussed how it can increase its sending rate.

4.2 Virtual Circuit and Datagram Networks

Just like how the transport layer can provide connectionless application service (UDP) and connection-oriented application service (TCP), can the network layer also provide the two. There are however some crucial differences:

  • In the network layer we have services for end-to-end hosts. In the transport layer we have services for application-to-application.
  • Computer networks who provide a connection service is called a virtual-circuit (VCs). Computer networks who provide a connectionless service is called a datagram network.
  • Transport-layer connection-oriented services are implemented in end hosts. Network-layer connection services are implemented in end hosts and routers.

While the Internet is a datagram network, many other networks are virtual-circuits. A VC consist of (1) a path between host and destination, (2) VC numbers, a number for each link in the path and (3) entries in the forwarding tables in each router in the path. A packet belonging to a VC has a VC number in its header. Because each link has its own VC number the router has to change passing packets their VC number. But why does the packet not just keep its VC number? By replacing the VC number we reduce the length of the VC header. We can agree to a common VC number for all links in the path but that would take a lot of messages to communicate through all the participating routers and links. There for it is way easier to randomly select VC numbers for links and just adjust them after each router. A VC network has to maintain connection state information for ongoing connections. Specifically, each time a VC connection is requested, an entry is made in the forwarding table, and when a VC connection is terminated, an entry is deleted. It is crucial whether or not a router maintains connection state information. The VC setup looks awfully a lot like the TCP setup. However there is one big difference between them. While in the transport layer setup there are only two end hosts that determine the parameters, like initial sequence numbers or cwnd sizes. Although the two end systems are aware of the transport-layer connection, the routers in the network layer are complete unaware of it. In a VC network though, the routers are fully aware of the VC connection. Messages that the VC needs to setup/change/close the the connection are called signaling messages with their own signaling protocols. In a datagram network, each time an end system wants to send a packet, it has to stamp the destination address on it and push it into the network. The packet just goes through routers and with their forwarding tables they send the packet the right way. The address printed on the packet is a certain amount of bits long. With 32 you have 4 billion possibilities so how do we find the correct one? We use a prefix in the forwarding tables. If an IP address comes by that fits the prefix, it is send to that corresponding link. When an IP address matches multiple prefixes, the router follows the rule of the longest prefix matching rule. The longer the prefix matches, the more accurate you are to your destination. The roots of a VC network is that from the telephony world where they use real circuits. The datagram network however was created out of necessity to connect computers. Because the Internet's is the best-effort service model results in minimum requirements for interconnecting networks.

4.3 What is inside a router?

A generic router has four components:

  • Input ports : Terminate incoming physical layer link, perform link layer functions to operate with the incoming link and issue a lookup function.
  • Switching fabric : Connects the input ports to the output ports.
  • Output ports : Create outgoing physical layer link and performing a link layer function for connection.
  • Routing processor : Executes the routing protocols, maintains and computes the forwarding table.

4.4 The Internet Protocol: Forwarding and Addressing in

the Internet

In this paragraph we will discuss both IPv4 and IPv6. First we will take a look at the Ipv4 datagram found on the next page:

  • Version number
  • Header length : Determines where the actual data begins
  • Type of service
  • Datagram length
  • Identifier, flags, fragmentation offset : Used for fragmentation
  • Time-to-live : Integer which decrements after each router pass and deletes itself if its 0.
  • Protocol : Determines the protocol used to pass data up and down layers.
  • Header checksum :
  • Source and destination IP
  • Options : Allows the header to be extended.
  • Data The IPv4 header is without options 20 bits long.

Each IP datagram is encapsulated within a link-layer protocol which limits the length of an IP datagram. Suppose you are a router and you receive an IP datagram that is too big for it's output port. You split the IP datagram into smaller IP datagrams, called fragments, and passes those down to the link layer. The smaller datagrams are reassembled at the destination. For the end host at the destination to reassemble the fragments Ipv4 has Identifier, flags, fragmentation offset as help. The Identifier is like the group name from the larger IP datagram, the flags are for indicating whether this is the last IP fragment or not and fragmentation offset is for indicating where this datagram fits in the original datagram. Fragmentation does have its costs. First it complicates the routers and end systems which now has to accommodate datagram fragmentation and reassembly. And secondly, fragmentation can be used for a lethal DoS attack. By sending packets with none of the fragmentation offset on 0, which causes the target to collapse trying to reconstruct degenerated packets. When a host wants to send something, it does it via its link. The boundary between host and link is called an interface. Because every host is capable of sending and receiving IP datagrams, IP requires everybody to have its own IP address. An IP address is 32 bits long and is written in dotted-decimal notation. Where each byte is separated by a dot. Each interface on every host and router has to have a globally unique IP address. A subnet is a network of partly the same IP addresses. For example: 223.1.1.0/24. The /24 is known as the subnet mask, it indicates that the leftmost 24 bits of the 32 bit address define the subnet's address. The subnet 223.1.1.0/24 thus consists of the three host interfaces (223.1.1.1, 223.1.1.2, and 223.1.1.3) and one router interface (223.1.1.4) The Internet's address assignment strategy is known as Classless Inter Domain Routing (CIDR). Organizations often get or buy their own subnet. The part indicating the subnet's domain, /24, could also be seen as a prefix. Only the prefix is considered by routers for outside the organization's network. When accessing something in your own organization you would not need the prefix because the remaining of the 32 bit after the prefix determines the specific host. Before CIDR was adopted we used a classfull addressing. There were classes with subnets. For example: class C(/8) has 254 hosts and class B(/16) has 65.000 hosts. This was a problem because class C was mostly too small but class B too big. Sending a message to 255.255.255.255 is sending it to everyone in the subnet.

Below this paragraph is an image of an IPv6 datagram and here are its specifications:

  • Expanded addressing capabilities : Increased size of IP addresses from 32 bit to 128 bits and introduced a new address type, anycast address, which allows a datagram to be delivered to any of ones of a group.
  • A streamlined 40 bytes header : New header has dropped or made fields optional to process datagrams faster.
  • Flow labeling and priority : The flow labeling field is for labeling packets with special request and the traffic field is for giving priority to special datagrams within a flow of packets.
  • Payload length
  • Next header : Determines to which protocol this datagram goes to.
  • Hop limit
  • Source and destination addresses
  • Data IPv6 does not allow fragmentation and reassembly at the intermediate routers. If a packet is too big to forward IPv6 sends a “Packet too big” ICMP error message. The sender has to resend the data in smaller IP datagrams. Fragmentation and reassembly is time consuming an thus removing it from the IP speeds up things considerably. Because the transport-layer and link-layer already perform checksums we don't need to perform it in the network layer which also speeds up things. But now, how do we transition from IPv4 to IPv6? The problem is that the new IPv6 can support IPv4 datagrams but not the other way around. One option would be to declare a flag day, a given time and date where all Internet machines would be turned off and upgraded. Sadly such enormous operation is just unthinkable to achieve in our current world. The most straightforward solution is to introduce dual-stack nodes. Nodes that can function with IPv4 and IPv6 datagrams. The DNS will supply information about whether this router is dual-stacked or not. However it is possible for two IPv6 nodes to only send IPv4 datagrams to each other instead of IPv6. See image on the next page. An alternative for the dual-stack would be tunneling. Tunneling is basically packing the entire IPv datagram in a IPv4 datagram and send it. We learned that it is hard to introduce protocols to the network layer, try changing the foundation without damaging the house. On the other side we could easily implement protocols to the application layer.

Al this talking about IP and so but what about it's security? For securing IP we use the IPsec. IPsec is compatible with IPv4 and IPv6 and only one of the hosts needs to have it for IPsec to run over the entire track. IPsec provides the following services:

  • Cryptographic agreement: Mechanism to allow hosts to communicate on encryption algorithms and keys.
  • Encryption of IP datagram payload
  • Data integrity : Verify that the datagram was not modified on its way here.
  • Origin authentication

Chapter 4.5 Routing Algorithms

The first router a host sends his datagram to is its default router/ first-hop router / source router and the last router is the destination router. Given that there are costs assigned to edges it is only natural to find the least-cost path to your destination. We define routing algorithms in two categories:

  • Global routing algorithms : Computes the least-cost path using a complete, global knowledge about the network. One condition is that it needs an overview of the network before it can do anything.
  • Decentralized routing algorithms : The least-cost path is computed in a distributed way. No node has complete information so each node starts with its direct attached links. Calculating the least-cost path step by step when communicating with other nodes. You could also classify them differently. In static routing algorithms the routes change very slow, often by human interaction. In dynamic routing algorithms the routes change depending on the traffic load or topology change. This is more responsive but more vulnerable to errors. In load- sensitive algorithms link costs vary due to underlying congestion, high cost equals high congestion. Most of the current routing algorithms are load-insensitive. In a link-state (LS) algorithm the network topology and link costs are known. This is achieved by broadcasting a link-state packet to and from every node. The link-state algorithm we will discuss is Dijkstra's algorithm. You start at Host A and want to get to Host Z. Dijkstra's algorithm calculates the sum of the route by visiting an unvisited nodes with the lowest costs and comparing the different sums to select and continue on the lowest cost path possible. Dijkstra's algorithm has a worst case complexity of O(n^2).

Bellman Ford found a interesting point. For Host A to reach Host C, it must first go to its direct neighbor, Host B. The least-cost path given in this formula: Where X is your starting point, C is the cost, V is your direct neighbor and Y is the destination. Host Z now updates its tables and sees that for Host Y to Host A changed from 5 to 6. Now calculating his distance to X: This will go on and one until the path is longer than going from X to Z over the link that costs 50. This is the count-to-infinity problem. The problem mentioned above here can be fixed by using a technique called poisoned reverse. If Host Z routes through Host Y to get to Host X, then Host Z will advertise to Host Y that from him to Host X the distance is equal to infinity. Host Z is telling Host Y a lie as long as Host Y routes via himself to Host X. This however is only applied on three or less nodes. In distance vector, each node talks only to its direct connected neighbors, but it provides them the least-cost path from itself to all other known nodes. In the LS algorithm, each node talks with all other nodes, but only tells them the costs of their direct links. Lets compare them next to each other:

  • Message complexity : In LS, every node has to know the cost of every edge and when one value changes, it has to be sent to every node. In DV, each node just has to talk to it's direct neighbors and only when one value changes that also affect the least-cost path is sent to other nodes.
  • Speed of convergence : LS has a O(N^2) worst case scenario. The DV algorithm converges slowly, has routing loops and suffers from the count-to-infinity problem.
  • Robustness : In the case of failure what can happen? LS could rebroadcast its lost packet, in a sense the routing computing is spread and thus more robust. In DV, messages are sent constantly thus there is a possibility of spreading a incorrect message throughout the entire network.

How we have viewed the routing systems until now is not entirely realistic. As the numbers of routers become larger, the amount of memory needed to store routing information in every single router would be enormous. It is also desirable to run and administer your network whilst being connected to the Internet. Both of these issues can be fixed when organizing routers into autonomous systems (ASs). Routers in the same group run the same routing algorithm. The routing algorithm running within an autonomous system is called an intra-autonomous system routing protocol. The different (ASs) need to be connected to each other so we need to assign some routers in the (ASs) as gateway routers. These routers connect the different (ASs). But how does the gateway router know where to route to when it has no knowledge of anything outside the (AS)? The collecting of information about whether the destination is reachable and sending this information to every router in the (AS) is done by the inter-AS routing protocol. The entirety of the Internet actually runs on one inter-AS routing protocol, named BGP which we will discuss at a later time. In hot-potato routing, the (AS) tries to get rid of the packets as soon and inexpensive as possible. This is done by sending the packet to the closest gateway router.

4.6 Routing in the Internet

Intra-AS routing protocol are also referred as interior gateway protocol. Two of them are called the Routing Information Protocol (RIP) and Open Shortest Path First (OSPF). In both RIP ans OSPF the cost is from the host till destination. RIP is a distance vector protocol that counts the amount of hops as costs, each link has a cost of 1. One hop is one subnet traversed, RIP is limited to 15 hops including destination hop. In RIP, routing updates are send every 30 seconds via a RIP response message/RIP advertisement. This message contains up to 25 destinations subnets within the (AS). Whenever a router has not received a RIP message for more than 180 seconds, it is declared as unreachable. These messages are sent using UDP. OSFP and its closely relative, IS-IS are typically upper tier ISP while RIP is more lower tier ISP. OSFP is a link-state information mixed with Dijkstra's algorithm. The administrator can set all edge values to 1 to achieve minimum-hop routing or he can set the values to weights and encourage congestion avoidance or discourage low bandwidth edges. OSPF broadcasts link-state to every node even if nothing has changed because that will increase robustness. The broadcast is send in an OSFP message and send directly via an IP datagram. The OSFP implements its own reliable data transfer and other features like:

  • Security : Messages between OSPF routers are authenticated which means that only trusted routers in the (AS) can partake. You can have simple and MD5 authentication. Simple authentication is configuring a password on each router. MD5 authentication is when a MD hash is computed from your data and send with the data to the receiver. The receiver also computes a MD5 hash from the data and if they are the same, then the data is authentic.
  • Multiple same-cost path : When multiple paths to a destination have the same costs, OSPF allows the use of those instead of stuffing it in one path.
  • Integrated support for unicast and multicast routing : Supports Multicast OSPF (MOSPF) which is OSPF with added features.
  • Support for hierarchy within a single routing domain : The ability to structure (AS) hierarchically.

4.7 Broadcast and Multicast Routing

In broadcast routing, the network layer provides a service of delivering a packet sent from a source node to all other nodes. Multicast routing enables this in a source node. The simplest way to achieve this is by sending the packet to the N destinations by making N copies of it and the use of unicast routing. This is called N-way-unicast. The first drawback is inefficiency, when a source is connected to the rest of the network via 1 link, then sending the N copies to the first router would be wasting bandwidth. The second drawback is that the source has to know the addresses of the destinations. At last the final drawback is that the unicast routes are computed by the link-state information but that would require broadcast which is not possible without unicast routes. Another obvious way of broadcast is a flooding approach. The source delivers a copy of the packet to every neighbor. A receiving party is to copy and forward the packet to all neighbors except from where it was received. One fatal flaw is that when there is a cycle in the network, then a part of the forwarding will go indefinitely. To prevent this we have a added a broadcast sequence number and its address to the packet. This is called sequence-number- controlled flooding. Each node maintain a list of bypassing addresses and sequence numbers. When a sequence number or address is recognized, the packet is dropped. A second approach was known as reverse path forwarding (RPF). A receiving node only forwards the packet when it arrived on the shortest path back to the source. Otherwise it could discard the packet because the other node is assured to receive a packet via their shortest route. A spanning tree is the minimum tree of nodes for the network to exist. In center-based approach of building a spanning tree, we have a center node, named rendezvous point, defined. Nodes then send three- join messages using unicast. The nodes will keep forwarding the three-join message until it reaches

Multicast service is delivering a packet to a subnet of network nodes. The first two problems are how to identify the subnet nodes and how to route to them. Multicast packets use address indirection. A single identifier is used to pick up that packet and copy and forward it to the group of receivers. The group of receivers associated with the D class addresses is called a multicast group. The Internet Group Management Protocol (IGMP) operates between the host and the direct attached router. IGMP has the means for the host to let the router know an application wants to join a multicast group. Like ICMP, IGMP is packet inside an IP datagram. The router first sends a membership_query message. Which the host will respond with the membership_report message. As last there is a leave_group message which is optional. You can also leave groups by not responding to the membership_query messages. This is an example of the soft state in an IP, you disconnect based on a timeout event. The multicast routing problem is that hosts joined to the multicast group are shaded in color. There are only certain subnets who should receive this multicast packet. You don't have to pass every node to find those subnets. The goal of multicast routing is to find the spanning tree of the subnets who should receive the packet. It is allowed to connect to non receiving nodes but you can skip them. There are two approaches for multicast routing:

  • Multicast routing using a group-shared tree : Multicast routing based on a tree connecting all edge routers with the attached hosts belonging to the multicast group. Just like how I explained above this paragraph.
  • Multicast routing using a sourc-based tree : Multicast routings are created for each possible source in the multicast group. There is however a drawback. Some nodes may receive a lot unwanted traffic when it just passes through. The solution to too much unwanted traffic is pruning. You send the upstream router a prune message. When you receive a prune message you should also send a prune message upstream to inform upper tiers to lower traffic to here. The first multicast routing protocol used in the Internet was the Distance-Vector Multicast Routing Protocol (DVMRP). This protocol has all what I just mentioned above. The most widely used protocol is the Protocol-Independent Multicast (PIM) which has two modes. One is dense mode in which it will flood more and the other mode is sparse mode which uses rendezvous nodes. Source-specific multicast (SSM) is where only a single sender is allowed to send traffic into the multicast tree.