Information Network Systems The network layer Stephan Sigg Tokyo, November 1, 2012
Error-detection and correction Decoding of Reed-Muller codes Assume a second order (16, 11) code for m = 4. The r-th order Reed-Muller code is formed by using as a basis the vectors v0, v 1,..., v m and all vector products of r or fewer of these vectors The 11 information symbols are denoted by a 0, a 4, a 3, a 2, a 1, a 43, a 42, a 41, a 32, a 31, a 21 The codevector is then Example for m = 4, r = 2: v0 = 1111111111111111 v4 = 0000000011111111 v3 = 0000111100001111 v2 = 0011001100110011 v1 = 0101010101010101 v4 v3 = 0000000000001111 v4 v2 = 0000000000110011 v4 v1 = 0000000001010101 v3 v2 = 0000001100000011 a 0 v0 + a 4 v4 + a 3 v3 + a 2 v2 + a 1 v1 + a 43 v4 v3 + a 42 v4 v2 + a 41 v4 v1 + a 32 v3 v2 + a 31 v3 v1 + a 21 v2 v1 = (b 1, b 2,..., b n) v3 v1 = 0000010100000101 v2 v1 = 0001000100010001 Stephan Sigg Information Network Systems 2
Error-detection and correction Decoding of Reed-Muller codes Assume a second Task order Error (16, 11) correction code for m = 4. Demonstrate the encoding, error correction and The r-th order decoding Reed-Muller withcode Reed-Muller is formed codes Example for m = 4, r = 2: by using as a basis the vectors v0, v 1,..., Encode a data sequence and specify the v m and all vector products of r or fewer of theseencoded vectors sequence The 11 information Induce symbols an are error denoted into the by encoded sequence Show how the error can be detected and a 0, a 4, a 3, a 2, a 1, a 43, a 42, a 41, a 32, a 31, a 21 corrected while decoding the information The codevector is then a 0 v0 + a 4 v4 + a 3 v3 + a 2 v2 + a 1 v1 + a 43 v4 v3 + a 42 v4 v2 + a 41 v4 v1 + a 32 v3 v2 + a 31 v3 v1 + a 21 v2 v1 = (b 1, b 2,..., b n) v0 = 1111111111111111 v4 = 0000000011111111 v3 = 0000111100001111 v2 = 0011001100110011 v1 = 0101010101010101 v4 v3 = 0000000000001111 v4 v2 = 0000000000110011 v4 v1 = 0000000001010101 v3 v2 = 0000001100000011 v3 v1 = 0000010100000101 v2 v1 = 0001000100010001 Stephan Sigg Information Network Systems 2
Introduction 04.10.2012 Introduction to the internet 11.10.2012 The link layer (1) 18.10.2012 The link layer (2) 25.10.2012 The network layer 01.11.2012 The transport layer 08.11.2012 The application layer 15.11.2012 Network management 22.11.2012 Security and cryptography 29.11.2012 Wireless and Mobile Networks (1) 06.12.2012 Wireless and Mobile Networks (2) 13.12.2012 Multimedia networking (1) 20.12.2012 Multimedia networking (2) 10.01.2013 Security in computer networks 17.01.2013 Content centric networking Stephan Sigg Information Network Systems 3
The network layer The Internet Protocol (IP) Introduction Application Transport Network Link Physical Stephan Sigg Information Network Systems 4 Routing Algorithms
Introduction Stephan Sigg Information Network Systems 5
Outline The network layer The Internet Protocol (IP) Routing Algorithms Stephan Sigg Information Network Systems 6
The network layer The role of the network layer is to move packets from a sending host to a receiving host The two important network functions to achieve this are Forwarding Every router has a forwarding table. The router moves an arriving packet to the appropriate output link as specified by the forwarding table. Routing The network layer must determine the route a packet shall take from source to destination. Such path is determined by a routing algorithm and impacts the contents of forwarding tables. Stephan Sigg Information Network Systems 7
The network layer Forwarding and Routing Stephan Sigg Information Network Systems 8
The network layer Link-layer switches and Routers We distinguish link-layer switches and Routers Link-layer switch Bases its decision on values in the fields of the link-layer frame Routers Base their forwarding decision on the value in the network-layer field. Stephan Sigg Information Network Systems 9
The network layer Network layer services The network service model defines the characteristics of end-to-end packet transport Possible services the network layer could provide: Guaranteed delivery Packets will eventually arrive at destination In-order packet delivery Packets will arrive in order sent Guaranteed minimal bandwidth Data arrives at least at a minimal bandwidth Guaranteed maximum jitter The time offset between packets should be similar at the transmitter and receiver Security services For instance, encryption of data between source and destination Stephan Sigg Information Network Systems 10
The network layer Network layer services Network architecture Service model Bandwidth Guarantee No-Loss Guarantee Internet Best Effort None None Ordering Any order possible Timing Not maintained Congestion indication None ATM CBR Guaranteed constant rate Yes In order Maintained Congestion will not occur ATM ABR Guaranteed minimum None In order Not maintained Congestion indication provided Stephan Sigg Information Network Systems 11
The network layer Network layer services Constant bit rate (CBR) ATM network service Anticipated for its capability to carry real-time, constant bit-rate audio and video traffic Guaranteed threshold for end-to-end delay jitter fraction of lost packets These thresholds are defined between the sending host and the ATM network when the CBR connection is first established Stephan Sigg Information Network Systems 12
The network layer Network layer services Available bit rate (ABR) ATM network service Slightly better than best-effort service Packets may be lost under ABR service Unlike in the Internet, packets can not be reordered Minimum packet transmission rate is guaranteed Can provide feedback to the sender (e.g. congestion notification bit or explicit rate at which to send) to help the sender to adapt its transmission rate Stephan Sigg Information Network Systems 13
Outline The network layer The Internet Protocol (IP) Routing Algorithms Stephan Sigg Information Network Systems 14
Routing in the network layer is conducted by the Internet Protocol (IP) Currently, we are within the process of traversing from the previous IP protocol (IPv4) to the new standard (IPv6) The IP protocol defines Addressing conventions Datagram format Packet handling Stephan Sigg Information Network Systems 15
The IPv4 protocol The IPv4 datagram contains 13 key fields Stephan Sigg Information Network Systems 16
The IPv4 protocol Version number (4 bits) Specify IP protocol version Helps the router to correctly interpret a received datagram Stephan Sigg Information Network Systems 17
The IPv4 protocol Header length (4 bits) Since datagram can contain variable number of options, this field specifies when the data begins Without options (most common) an IPv4 datagram header is 20 bytes long Stephan Sigg Information Network Systems 18
The IPv4 protocol Type of service (8 bits) specifies different types of IP datagrams (low delay, high throughput, reliability) Stephan Sigg Information Network Systems 19
The IPv4 protocol Datagram length (16 bits) Total length of the IP datagram (header plus data) measured in bytes Theoretical maximum size of IP datagram is 65535 bytes but datagrams are rarely larger than 1500 bytes Stephan Sigg Information Network Systems 20
The IPv4 protocol Identifier, flags, fragmentation offset (16 + 3 + 13 bits) Information for IP fragmentation No longer included in IPv6 Stephan Sigg Information Network Systems 21
The IPv4 protocol Time-to-live (TTL) (8 bits) Ensures that datagrams do not circulate forever Decremented by one each time the datagram is processed by a router If the TTL field reaches 0, the datagram is dropped Stephan Sigg Information Network Systems 22
The IPv4 protocol Protocol (8 bits) Used only when datagram reaches its final destination Indicates the specific transport-layer protocol to which it should be passed Stephan Sigg Information Network Systems 23
The IPv4 protocol Header checksum (16 bits) Checksum to detect bit errors in a received datagram header (only the header! TCP/UDP checksum for entire segment) Computed by treating each 2 bytes in the header as a number and summing these numbers using 1s complement If an error is detected, the datagram is typically discarded Stephan Sigg Information Network Systems 24
The IPv4 protocol Source and destination IP addresses (32 bits each) Addresses of source and destination hosts Utilised for forwarding and routing through a network Stephan Sigg Information Network Systems 25
The IPv4 protocol options (variable length) Enable the specification of specific options Rarely used and merely add overhead to the processing of an IP packet Not included in IPv6 Stephan Sigg Information Network Systems 26
The IPv4 protocol Data (payload) (variable length) Contains the data to be transmitted Most often this field contains the transport-layer segment (TCP or UDP) Can also carry other kinds of messages such as ICMP Stephan Sigg Information Network Systems 27
IP datagram fragmentation The size of datagrams that can be carried (Maximum Transmission Unit (MTU)) by link-layer protocols differs larger datagrams are therefore fragmented into smaller ones Stephan Sigg Information Network Systems 28
IP datagram fragmentation In IPv4 datagrams are splitted at routers when necessary but reassembly is done at the receiving end Identification, Flag and fragmentation offset filds in the IP datagram to reassemble datagrams in the correct order All fragmented datagram share the identification number with the original datagram The offset field specifies the position in the set of fragments The binary flag field is 1 for all fragments short of the last Stephan Sigg Information Network Systems 29
IP datagram fragmentation Stephan Sigg Information Network Systems 30
IPv4 addressing IPv4 are 32 bits (4 bytes) long 2 3 2 4 billion possible IP addresses Dotted-decimal notion (each byte written in decimal form separated by period (dot): 193.132.216.9 Binary notation: 11000001 00100000 11011000 00001001 Stephan Sigg Information Network Systems 31
Classless Interdomain Routing (CIDR) Router interfaces may form a subnet as e.g. 223.1.1.0/24 The term /24 is the subnet mask Defines the leftmost 24 bits to be the subnet address All nodes in this subnet share this subnet address Used since 1995. Before: Classful addressing with Class A (/8), B (/16) and C (/24) networks only Stephan Sigg Information Network Systems 32
Classless Interdomain Routing (CIDR) Notation Addresses Subnetmask decimal Subnetmask binary /0 4.294.967.296 0.0.0.0 00000000.00000000.00000000.00000000 /1 2.147.483.648 128.0.0.0 10000000.00000000.00000000.00000000 /2 1.073.741.824 192.0.0.0 11000000.00000000.00000000.00000000 /3 536.870.912 224.0.0.0 11100000.00000000.00000000.00000000 /4 268.435.456 240.0.0.0 11110000.00000000.00000000.00000000 /5 134.217.728 248.0.0.0 11111000.00000000.00000000.00000000 /6 67.108.864 252.0.0.0 11111100.00000000.00000000.00000000 /7 33.554.432 254.0.0.0 11111110.00000000.00000000.00000000 /8 16.777.216 255.0.0.0 11111111.00000000.00000000.00000000 /9 8.388.608 255.128.0.0 11111111.10000000.00000000.00000000 /10 4.194.304 255.192.0.0 11111111.11000000.00000000.00000000 /11 2.097.152 255.224.0.0 11111111.11100000.00000000.00000000 /12 1.048.576 255.240.0.0 11111111.11110000.00000000.00000000 /13 524.288 255.248.0.0 11111111.11111000.00000000.00000000 /14 262.144 255.252.0.0 11111111.11111100.00000000.00000000 /15 131.072 255.254.0.0 11111111.11111110.00000000.00000000 /16 65.536 255.255.0.0 11111111.11111111.00000000.00000000 /17 32.768 255.255.128.0 11111111.11111111.10000000.00000000 /18 16.384 255.255.192.0 11111111.11111111.11000000.00000000 /19 8.192 255.255.224.0 11111111.11111111.11100000.00000000 /20 4.096 255.255.240.0 11111111.11111111.11110000.00000000 /21 2.048 255.255.248.0 11111111.11111111.11111000.00000000 /22 1.024 255.255.252.0 11111111.11111111.11111100.00000000 /23 512 255.255.254.0 11111111.11111111.11111110.00000000 /24 256 255.255.255.0 11111111.11111111.11111111.00000000 Stephan Sigg Information Network Systems 33
Obtaining IP addresses IP addresses are managed by the Internet Corporation for Assigned Names and Numbers (ICANN) Allocates IP addresses to Internet Service Providers (ISP) Nonprofit organisation Also manages the DNS root servers Stephan Sigg Information Network Systems 34
Dynamic Host Configuration Protocol (DHCP) IP addresses are most often assigned automatically in a network DHCP provides IP address, subnet mask, address of first-hop router (default gateway) and address of local DNS server Stephan Sigg Information Network Systems 35
Dynamic Host Configuration Protocol (DHCP) Stephan Sigg Information Network Systems 36
Dynamic Host Configuration Protocol (DHCP) Four steps to obtain an IP address 1. DHCP server discovery 2. DHCP server offer 3. DHCP request 4. DHCP ACK Stephan Sigg Information Network Systems 37
DHCP server discovery DHCP discover message sent as UDP packet to port 67 Encapsulated in IP datagram to the broadcast address 255.255.25.255 Source IP address set to 0.0.0.0 Stephan Sigg Information Network Systems 38
DHCP server offer DHCP server responds with a DHCP offer message Broadcast to all nodes (255.255.255.255) in an IP datagram Contains transaction ID, received discover message, proposed IP address, network mask and a lease time Lease time specifies the amount of time for which the IP address is valid Stephan Sigg Information Network Systems 39
DHCP request Client chooses among one or more server offers and responds to the selected offer with a DHCP request message Message contains the proposed configuration parameters Stephan Sigg Information Network Systems 40
DHCP ACK Server responds and confirms parameter by sending a DHCP ACK message Stephan Sigg Information Network Systems 41
Support of mobility In increasingly mobile networks, the approach of DHCP does have shortcomings In particular, a mobile node traversing among several subnets would have to request a new IP each time it enters a subnet At this occasion, ongoing transport layer connections typically have to be dropped. A possible solution can be provided by mobileip (considered later in the lecture) Stephan Sigg Information Network Systems 42
Network Address Translation (NAT) A local network behind a router does not have to request an IP address for each computer from the ISP or ICANN The network address translation (NAT) approach provides a solution that separates the local network from the internet Distinction between local computers via ports (>60000 available) Stephan Sigg Information Network Systems 43
Network Address Translation (NAT) Stephan Sigg Information Network Systems 44
Problems of NAT In the first place, NAT is a hack that is not fully compatible with the IP address structure NAT interferes with P2P applications (VoIP, file sharing) P2P applications require all hosts to become servers, effectively establishing TCP connections among each other Applications that send IP addresses or port numbers hidden within their data packets do not work with NAT Stephan Sigg Information Network Systems 45
Solution to NAT related problems As a solution, the application could use an address server which is not behind any NAT Hosts connect to this server first, sending the IP address they think they have The server notes the actual address received and the address the host believes to have The server then sends both addresses all peers to inform them of the mapping between actual and NAT address Stephan Sigg Information Network Systems 46
The Internet Control Message Protocol (ICMP) ICMP is used to communicate network-layer information Encapsulated in an IP packet Also utilised by some application programs (ping, traceroute) Stephan Sigg Information Network Systems 47
The Internet Control Message Protocol (ICMP) ICMP type Code Description 0 0 echo reply (to ping) 3 0 destination network unreachable 3 1 destination host unreachable 3 2 destination protocol unreachable 3 3 destination port unreachable 3 4 destination network unknown 4 0 source quench (congestion control) 8 0 echo request 9 0 router advertisement 10 0 router discovery 11 0 TTL expired 12 0 IP header bad Stephan Sigg Information Network Systems 48
Traceroute and its utilisation of the ICMP Sends a series of ordinary IP datagrams to the destination Each carries a UDP segment with an unlikely UDP port number TTL of these datagrams is increased from 1 Source starts timer for each datagram n-th router replies ICMP message (TTL expired); Incl. name and IP With this, source records round-trip time of the n-th packet Destination replies port unreachable ICMP message (unlikely port) Stephan Sigg Information Network Systems 49
IPv6 Development started in early 1990s by the Internet Engineering Task Force Reason: IP address space was beginning to be used up Also, some improvements above IPv4 Europe s Third Generation Partnership Program (3GPP) has specified IPv6 as the standard addressing scheme for mobile multimedia Estimates in 1996 predicted that addresses would become exhausted between 2008 and 2018 Stephan Sigg Information Network Systems 50
IPv6 IP address space is managed by the Internet Assigned Numbers Authority (IANA) globally Additinally, five regional Internet registries (RIR) are responsible for this management Stephan Sigg Information Network Systems 51
IPv6 03.02.2011 IANA unallocated address pool exhaustion 15.04.2011 APNIC unallocated address pool exhaustion Stephan Sigg Information Network Systems 52
IPv6 datagram format IPv6 header simpler, more streamlined Stephan Sigg Information Network Systems 53
IPv6 datagram Most important changes Expanded addressing capabilities 128 bit addresses (every grain of sand could obtain an IP address) Streamlined 40 byte header Possible since some IPv4 fields have been dropped Flow labelling and priority Sender may request specific handling (QoS) for packets belonging to a specific flow Stephan Sigg Information Network Systems 54
IPv6 datagram fields Version (4 bit) Describes the IP version Traffic class (8 bit) Similar to Type of service field in IPv4 Stephan Sigg Information Network Systems 55
IPv6 datagram fields Flow label (20 bit) Identify flow of datagrams and their QoS and handling IPv6 can label packets as belonging to a particular flow Special handling of flows For instance, audio and video transmission Stephan Sigg Information Network Systems 56
IPv6 datagram fields Payload length (16 bit) Number of bytes in the datagram following the fixed-length 40 byte header Stephan Sigg Information Network Systems 57
IPv6 datagram fields Next header (8 bit) Identifies the protocol to deliver the data contents to in the transport layer (cf. protocol field in IPv4) Hop limit (8 bit) Similar to TTL in IPv4 Stephan Sigg Information Network Systems 58
IPv6 datagram fields Source and destination addresses (128 bit each) 128 bit source and destination addresses data (variable length) Payload Stephan Sigg Information Network Systems 59
IPv6 datagram removed fields Fragmentation/Reassembly IPv6 does not allow fragmentation at routers. Fragmentation only at source nodes. Retransmission if packet too big (new ICMP error message Packet too big ) Header checksum Removed for redundancy. Checksum already in transport layer and link layer Options Now one of the possible next headers pointed to from within the IPv6 header Stephan Sigg Information Network Systems 60
Transition from IPv4 to IPv6 Dual-stack Might force IPv6 nodes to use IPv4 Stephan Sigg Information Network Systems 61
Transition from IPv4 to IPv6 Tunneling Stephan Sigg Information Network Systems 62
Outline The network layer The Internet Protocol (IP) Routing Algorithms Stephan Sigg Information Network Systems 63
Routing algorithms To generate forwarding tables in routers, routing algorithms are applied Today, there are two basic algorithms applied in the internet Centralised Link state algorithms (e.g. Dijkstra) Distributed Distance Vector algorithms Routing problem defined by edge-weighted graph G = (N, E) Stephan Sigg Information Network Systems 64
Routing algorithms Dijkstra a centralised link state algorithm 1. Assign a distance cost D( ) = to all nodes short of a source node u with D(u) = 0. 2. As long as nodes v with D(v) = exist, choose from these the node v with minimum edge cost c(x, v) to any node x with D(x) <, set D(v) = D(x) + c(x, v) and update for all neighbours w of v the value D(w) = min (D(w), D(v) + c(v, w)) Stephan Sigg Information Network Systems 65
Routing algorithms Dijkstra a centralised link state algorithm The Dijkstra algorithm solves the problem of finding shortest paths between a source node u and all other nodes in time O(n 2 ) The algorithm is centralised in a sense that it requires the cost of all edges in the network Stephan Sigg Information Network Systems 66
Routing algorithms Distance vector routing a decentralised algorithm Observe that for any least-cost path d x (y) from x to y, the least cost can be described by d x (y) = min v (c(x, v) + d v (y)) (1) 1. Each node u assigns a distance cost D( ) = to all nodes short of itself with D(u) = 0. These costs are maintained in a distance vector DV u by each node. 2. For each of its neighbours w, a node u sets D(w) = c(u, w) 3. From time to time, each node u sends DV u to all its neighbours w 4. At receiving DV w, a node u updates its DV u according to equation (1) Stephan Sigg Information Network Systems 67
Routing algorithms Distance vector routing a decentralised algorithm Distance vector routing is a decentralised approach since only local information is required It is robust against unavailable links and dying nodes The algorithm is slower than Dijkstra Stephan Sigg Information Network Systems 68
Routing algorithms Task Routing algorithms For the given network, calculate the shortest paths with the Dijkstra and the distant vector algorithm and report your results. Stephan Sigg Information Network Systems 69
Outline The network layer The Internet Protocol (IP) Routing Algorithms Stephan Sigg Information Network Systems 70
The network layer The Internet Protocol (IP) Conclusion Comoputer Networking A Top-Down Approach J.F. Kurose and K.W. Ross 6th edition, 2012 Pearson study Addison-Wesley ISBN: 978-0-13-285620-1 Stephan Sigg Information Network Systems 71 Routing Algorithms
Conclusion Do you have any questions? Stephan Sigg sigg@nii.ac.jp Stephan Sigg Information Network Systems 72