1 / 97

The Network Layer

The Network Layer. Network Layer. Recall: The network layer is responsible for the routing of packets The network layer is responsible for congestion control. Contents. Connection-Oriented and Connectionless Service The IP Protocol IP-Support Protocols Routing Algorithms

catharinej
Download Presentation

The Network Layer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Network Layer

  2. Network Layer • Recall: • The network layer is responsible for the routing of packets • The network layer is responsible for congestion control

  3. Contents • Connection-Oriented and Connectionless Service • The IP Protocol • IP-Support Protocols • Routing Algorithms • Congestion Control

  4. 1. Connection-Oriented and Connectionless Service • Network layers can offer two types of service to the transport layer: • Connection-oriented service • Network layer provides the Transport layer with a reliable service: all packets will be delivered (flow control), in-sequence delivery • Connection setup required before communication begins • Connectionless service • No guarantee • No prior connection setup required; packets are stored and forwarded one at a time by IMPs

  5. 1.1 Connection-Oriented Service • How to provide connection-oriented service: • Set up a route (virtual circuit) between source and destination • That route is used for all traffic flowing over the virtual circuit • IMP maintains an internal table to tell which outgoing line to forward packet on for each active virtual circuit • Packets must contain a virtual circuit number so that IMP can figure out how to forward them

  6. Connection-Oriented Service: Analogy • Public Telephone Network • Set up a virtual circuit (dial a number) • Transmit data on the circuit (conversation) • Close down the virtual circuit (hang up) • Two users are provided with the illusion of a dedicated point-to-point channel • Information is delivered to the receiver in the same order in which it is transmitted by the sender

  7. 1.2 Connectionless Service • How to provide connectionless service: • Send the packet into the network and allow the network to forward it however it likes • IMPs maintain routing tables to look up the next IMP for each arriving packet • Each packet must contain a destination address so the IMPs can make routing decisions

  8. Connectionless Service: An Analogy • Postal service: • Each packet (letter) is transported as an individual entity • Each packet (letter) must carry the complete destination address • If a packet (letter) is lost, error control is the user’s responsibility • Packets (letters) do not necessarily arrive in the order sent

  9. 1.3 Comparison between Connectionless and Connection-Oriented Services • Connection Setup Procedure: • Connection-oriented service • Explicit setup and tear-down required • For short transaction oriented communication, the delay of connection setup may be expensive • Connectionless service • No setup or tear-down required • For long continuous communication, the overhead of packet headers may be expensive

  10. Comparison (cont’d) • Header Overhead • Connection-oriented service • Only the virtual circuit number • Connectionless service • The full destination address is required

  11. Comparison (cont’d) • Message Sequence: • Connection-oriented service • Sequence automatically maintained • Connectionless service • Destination may have to re-sequence out-of-sequence messages

  12. Comparison (cont’d) • Robustness • Connection-oriented service • Vulnerable: If IMP crashes, all virtual circuits passing through it have to be aborted and re-established • Connectionless service • Robust: If IMP goes down, only hosts whose packets were queued at the time of the crash are lost. Other packets will be rerouted dynamically.

  13. Comparison (cont’d) • Guaranteed service: • Connection-oriented service • Can provide guarantees on the delays and throughput of packets being sent • Connectionless service • It is very difficult to provide guarantees for timely packet delivery

  14. Summary • Connection-oriented service • Is useful for applications which prefer in-sequence delivery of packets. It is also preferable for applications that require guaranteed service • Connectionless service • Provides flexibility in the routing and handling of individual packets and is robust in the face of IMP crashes

  15. 2. The Internet Protocol (IP) • Provides delivery of packets from one host in the Internet to any other host in the Internet, even if the hosts are on different networks • Internet packets are often called “datagrams” and may be up to 64 kilobytes in length (although they are typically much smaller) • Internet IMPs are known as “routers” and they operate in a connectionless mode

  16. 2.1 IP Packet Format 32 bits Ver. IHL Type of Serv. Total Length D F M F Identification Fragment Offset Time to Live Protocol Header checksum Source address Destination address Options (0 or more 32-bit words) Data (0 to 65,515 bytes)

  17. IP Packet Fields • Version • The IP version number (4 & 6) • IHL • IP Header Length in 32-bit words • Type of Service • Contains priority information, rarely used • Total Length • The total length of the datagram in bytes • Includes header

  18. IP Packet Fields (cont’d) • Identification • When an IP packet is segmented into multiple fragments, each fragment is given the same identification • This field is used to reassemble fragments • DF • Don’t Fragment • MF • More Fragments • When a packet is fragmented, all fragments except the last one have this bit set

  19. IP Packet Fields (cont’d) • Fragment offset • The fragment’s position within the original packet • Time to Live • Hop count, decremented each time the packet reaches a new router • When hop count = 0, packet is discarded • Protocol • Identifies which transport layer protocol is being used for this packet • Header Checksum • Verifies the contents of the IP header • Not polynomial-based

  20. IP Packet Fields (cont’d) • Source and Destination Addresses • Uniquely identify sender and receiver of the packet • Options • Up to 40 bytes in length • Used to extend functionality of IP • Examples: source routing, security, record route • source routing, also called path addressing, allows a sender of a packet to partially or completely specify the route the packet takes through the network. In contrast, in non-source routing protocols, routers in the network determine the path based on the packet's destination

  21. 2.2 IP Addresses • 32 bits long (4 bytes) • Notation: • Each byte is written in decimal in MSB order, separated by dots • Example: 128.195.1.80 • 0.0.0.0 (lowest) to 255.255.255.255 (highest) • Address Classes • Class A, B, C, D, E • Loopback • Broadcast

  22. IP Address Classes Class 32 bits 0 Net Type of Serv. Host (24 bits) A 10 Net Host (16 bits) B 110 Net Host (8 bits) C 1110 Multicast address D 11110 Reserved E

  23. IP Address Classes • Class A: • For very large organizations • 16 million hosts allowed • Class B: • For large organizations • 65 thousand hosts allowed • Class C • For small organizations • 255 hosts allowed • Class D • Multicast addresses • No network/host hierarchy

  24. Class E • reserved • Loopback • 127.xx.yy.zz (127.anything) is reserved for loopback testing • packets sent to this address are not put out onto the wire; they are processed locally and treated as incoming packets. • Broadcast • all 1s

  25. IP Address Hierarchy • Note that Class A, Class B, and Class C addresses only support two levels of hierarchy • Each address contains a network and a host portion, meaning two levels of hierarchy • However, the host portion can be further split into “subnets” by the address class owner • This allows for more than 2 levels of hierarchy

  26. Subnetting We use different subnets (logical) for different VLANS(physical) Example: Class B address with 8-bit subnetting 16 bits 8 bits 8 bits Network id Subnet id Host id Example Address: 165.230 .24 .8 Class 32 bits 10 Net Host B

  27. Subnet Masks Subnet masks allow hosts to determine if another IP address is on the same subnet or the same network Note: The number of ones on the left can also determine the subnet mask; they show it with /24 16 bits 8 bits 8 bits Network id Subnet id Host id 1111111111111111 11111111 00000000 Mask: 255.255 .255 .0

  28. Subnet Masks (cont’d) Assume IP addresses A and B share subnet mask M. Are IP addresses A and B on the same subnet? 1. Compute (A and M). (Boolean AND) 2. Compute (B and M). (Boolean AND) 3. If (A and M) = (B and M) then A and B are on the same subnet. Example: A and B are class B addresses A = 165.230.82.52 B = 165.230.24.93 M = 255.255.255.0 Same network? Same subnet?

  29. Note • 0 AND 0 = 0 • 0 AND 1 = 1 AND 0 = 0 • 1 AND 1 = 1 • Thus, computing (A and M) results in • Network ID = Network ID of A • Subnet ID = Subnet ID of A • Host ID = 0

  30. Why do we need subnet mask? • When subnetting is introduced, a routing table is modified to include (this-network, subnet, 0) and (this-network, this-subnet, host)

  31. Routing table network ID subnet ID host ID this network this subnet A this network this subnet B this network different subnet 0 this network different subnet 0 different network 0 0 • Subnet mask helps quickly identifying which routing table entry to look up

  32. W X Y Z A B C D 2.3 IP Routing How do you get a packet from one network to another? ?

  33. W W X X Y Y Z Z A A B B C C D D IP Routing (cont’d) Answer: with a router (or a series of routers) Case 1: Single hop R Case 2: Multi-hop Network Cloud R R

  34. N1 R1 N2 Deliver directly N3 Deliver directly N4 R3 Example R1 R2 R3 N1 N2 N3 N4 Dest Next hop Routing table @ R2 Actual routing table contains IP addresses, Flags indicating type of entries, net mask etc. (see Stevens pg. 113, sect 9.2)

  35. Searching the routing table • First, search for a matching host address • Flag H is set • Second, search for a matching network address • Need to know the number of bits to use for network ID • Third, search for a default entry • Execute netstat -rn on your machine and find the contents of the routing table • Default entry allows for a single entry for a list of entries that have the same next-hop value

  36. 3. IP Support Protocols • ARP • RARP • ICMP

  37. 3.1 ARP • Address Resolution Protocol • Returns a MAC sublayer address when given an Internet (IP) address • Commonly used in broadcast LANs so that two hosts can communicate using IP addresses instead of MAC sublayer addresses

  38. MAC Layer Ethernet Frame Format Multicast bit Destination (6 bytes) Source (6 bytes) Length (2 bytes) Data (46-1500 bytes) Pad Frame Check Seq. (4 bytes)

  39. IP Address Classes Class 32 bits 0 Net Type of Serv. Host A 10 Net Host B 110 Net Host C 1110 Multicast address D 11110 Reserved E

  40. ARP (cont’d) ARP packet containing “128.195.1.38?” ARP Ethernet Address: 05:23:f4:3d:e1:04 IP Address: 128.195.1.20 Ethernet Address: 12:04:2c:6e:11:9c IP Address: 128.195.1.122 Ethernet Address: 98:22:ee:f1:90:1a IP Address: 128.195.1.38 Wants to transmit to 128.195.1.38 Ignored Answered

  41. ARP (cont’d) ARP response packet containing “98:22:ee:f1:90:1a” Repl Ethernet Address: 05:23:f4:3d:e1:04 IP Address: 128.195.1.20 Ethernet Address: 12:04:2c:6e:11:9c IP Address: 128.195.1.122 Ethernet Address: 98:22:ee:f1:90:1a IP Address: 128.195.1.38

  42. 3.2 RARP • Reverse Address Resolution Protocol • RARP performs the inverse action of ARP • RARP returns an IP address for a given MAC sublayer address • Operationally, RARP is the same as ARP

  43. 3.3 ICMP • Internet Control Message Protocol • Handles special Internet control functions • Responsibilities: • Reporting unreachable destinations • Reporting IP packet header problems • Reporting routing problems • Reporting echoes (pings)

  44. ICMP • Protocol for error detection and reporting • tightly coupled with IP, unreliable • ICMP messages delivered in IP packets • ICMP functions: • Announce network errors • Announce network congestion • Assist trouble shooting • Announce timeouts

  45. ICMP MSG IP header Source, Destination Address, TTL, ... ICMP MSG Message type, Code, Checksum, Data Message type examples (Figure 6.3 in Stevens book): 0 (8) echo request (reply) 3 destination unreachable 4 source quench 11 time exceeded

  46. Specific uses of ICMP • Echo request/reply • Can be used to check if a host is alive • Address mask request/reply • Learn the subnet mask • Destination unreachable • Invalid address and/or port • Source quench • choke packet

  47. TTL (Time To Live) expired • Routing loops, or too far away

  48. Ping • Uses ICMP echo request/reply • Source sends ICMP echo request message to the destination address • Echo request packet contains sequence number and timestamp • Destination replies with an ICMP echo reply message containing the data in the original echo request message • Source can calculate round trip time (RTT) of packets • If no echo reply comes back then the destination is unreachable

  49. Ping (cont’d) A R1 R2 R3 B Echo request Time Echo reply

More Related