1 / 41

Chapter 4

Chapter 4. Network Layer. O BJECTIVES. Understand the rationale for the existence of the network layer. Understand the concept of host-to-host delivery. Understand the duties of the network layer: packetizing, addressing, and routing.

ratana
Download Presentation

Chapter 4

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. Chapter 4 Network Layer

  2. OBJECTIVES Understand the rationale for the existence of the network layer. Understand the concept of host-to-host delivery. Understand the duties of the network layer: packetizing, addressing, and routing. Know which upper-layer protocol can use the services of IP. Understand the network layer protocol, IP, used in the Internet. Understand the position of the network layer in the Internet model. After reading this chapter, the reader should be able to:

  3. 4.1 INTRODUCTION

  4. Figure 4-1 Network layer in the Internet model • The network layer provides host-to-host delivery. • Host-to-host : from the source computer to the destination computer. • A network-layer protocol takes a message from a computer and delivers it to another computer.

  5. Figure 4-2 Duties of the network layer

  6. 4.2 ADDRESSING

  7. Note: The network addresses must be unique.

  8. At the network layer, we need to uniquely identify each device on the Internet to allow global communication between all devices. (analogous to the telephone system) • The addresses used in the network layer must uniquely and universally define the connection of a host (computer) or a router to the Internet. • IP Address • Addresses used in the Internet are called IP address. • An IP address is made of 4 bytes(32 bits), where each byte can have a value between 0 and 255. • The bytes are separated by a dot(.) when used by people and programs. Ex: 10.34.234.8 • The notation is referred to as dotted-decimal notation.

  9. Technical Focus:Binary Notation of IP Addresses An IP address is stored as a binary number in the computer. A 4-part dotted-decimal address can be converted to binary if we replace each part by its binary equivalent. The following shows the IP address 10.34.234.8 in dotted-decimal and binary notation: 10.34.224.8 00001010 00100010 11100000 00001000

  10. Technical Focus:Address Space A protocol such as IP that defines addresses has an address space. An address space is the total number of addresses available to the protocol. If a protocol uses N bits to define an address, the address space is 2N because each bit can have two different values (0 and 1); N bits can have 2N values. The Internet uses 32-bit addresses, which means that the address space is 232 or 4,294,967,296 (more than 4 billion). This means that theoretically, if there were no restrictions, more than 4 billion devices could be connected to the Internet.

  11. If an organization has only one single network( which is improbable ),two levels of addressing is adequate. Ex: Figure 4.3 shows a hypothetical network in an organization. The organization is granted 65536 addresses from the Internet authorities. The addresses range from 181.74.0.0 to 171.74.255.255. Note: This range contains 65536 addresses because the third and the fourth bytes can have values of 0 to 255 and 256*256 is 65536. The first address,181.74.0.0 is a reserved address and represents the entire network( organization); the last address 181.74.255.255 is also a reserved address and represents a limited broadcast address( used in case a host wants to send a message to every host.) The remaining addresses belong to the organization and can be assigned to hosts. Two-Level Address: Network and Host

  12. Figure 4-3 Two levels of hierarchy • All hosts always have the first two parts of the address(181.74)in common. • The common part of the address is called the netid (or prefix); the value part is called the hostid. • The first address in the group,which always has a hostid of zero,is called the network address.

  13. Note: When using two levels of address hierarchy, the common part is referred to as the netid or prefix and the variable part is referred to as the hostid, or suffix.

  14. In this three-level addressing scheme,the individual LANs are referred to as subnetworks(or subnets) while the whole system is referred to as a network (or site). The addresses can reflect this hierarchy in the physical network. Ex: If the campus is granted 65536 addresses,the first 2 bytes can define the whole network (site); the third byte can define the subnet; and the fourth byte can define a host on a subnet. The first 2bytes,are the same for all computers. The third byte is the same for those computers connected to the same subnet,and the fourth byte is unique for each computer. Some addresses have special meaning. The first address defines the entire site(campus). The first address of each subnet define the subnet address. The last address of each subnet is used for broadcasting to all computers in the same subnet. Three-Level Address: Network, Subnetworkand Host

  15. Figure 4-4 Three levels of hierarchy

  16. Note: With three levels of address hierarchy, the common part is referred to as the netid. The part common to all computers connected to the same subnet is referred to as the subnetid. The unique part is referred to as the hostid.

  17. Note: A packet traveling from the source to the destination needs at least four addresses: source and destination port numbers and source and destination IPaddresses. Application-layer address www.fhda.edu Transport-layer address46017,80(client and server port number) Network-layer address201.23.56.8,181.17.43.56(source and destination IP addresses)

  18. Domain Name System Application-Layer protocol A computer that needs to obtain an IP destination address uses the client DNS. A computer that stores the mapping between the application-layer address and the IP address used the server DNS. Every computer knows the address of at least one DNS server. It sends its request to that server. Either the server knows the IP address corresponding to the application-layer address, or it knows another server that does.

  19. Figure 4-5 DNS example A user is sitting at a computer with IP address 200.31.45.8 and wants to send a message to the company with web(application-layer)address www.goodproduct.com.

  20. 4.3 ROUTING

  21. Network cables are plugged into routers or hubs, which help direct information transfer across the network. Ex: figure 4.6 A packet starting from host A can follow two different routes to reach host B. It can go through LAN1,R1(a router),LAN3,R2,WAN1,R5, and LAN6. Or go through LAN1,R1,LAN3,R2,LAN5,R4,WAN2,R6,and LAN6. Routing

  22. Figure 4-6 Example of portion of the Internet

  23. There are two questions here: Which of the above routes must the packet take? When a choice is made,how is the packet routed to reach the final destination? The answer to the first question depends on the type of service (TOS) required by the packet. Ex: figure4.7 Host A can include a field in the packet that specifies that the packet is to travel through a minimum delay route or a reliable route. (The routers can use the value in this field to make a decision.) Videoconferencing requires minimum delay. File transfer requires reliability.

  24. Figure 4-7 Routing decisions

  25. Figure 4-8 Routing table for router R1

  26. Figure 4-9 Routing tables • The answer to the second question is routing tables. • Each router must have (at least) two tables: • One table to route packets that need minimum delay and another for packets that need reliability.

  27. Note: Routing tables can be based on next-hop routing.

  28. Host-specific: each row is based on the host address. Network specific: each row is based on the network address. Size of routing table

  29. Note: Routing tables for the Internet are usually network-specific rather than host-specific. The router routes the packet to the final network; it is then broadcast to reach the final destination. Network-based routing reduces the size of routing tables.

  30. Another way to reduce the size of a routing table is to divide the Internet into smaller sections called autonomous systems. Autonomous systems(AS) is a group of networks and routers under the authority of a single administration. Routing inside an autonomous systems is referred to as interior routing. Routing between autonomous systems is referred to as exterior routing. This is also called hierarchical routing. Autonomous systems

  31. Figure 4-10 Autonomous systems

  32. Note: Routing in the Internet is hierarchical. Delivery is first made to the autonomous system, then to the network, and finally to the host. Hierarchical routing reduces the size of the routing tables.

  33. Static Versus Dynamic Routing Static Routing Table Dynamic Routing Table Routing Protocols RIP(Routing Information Protocol) An interior routing protocol used inside an autonomous system. In distance vector routing ,each router periodically shares its knowledge about the entire internet with its neighbors. The three keys to understanding how this algorithm works are as follows: Sharing knowledge about the entire autonomous system. Sharing only with neighbors. Sharing at regular interval.

  34. OSPF(Open Shortest Path First) Another interior routing protocol that is gaining in popularity. Its domain is also autonomous system. Link state routing is a process in which each router shares its knowledge about its neighborhood with every router in the area. The three keys to understanding how this algorithm works are as follows: Sharing knowledge about the neighborhood. Sharing with every other router. Sharing when there is a change.

  35. BGP(Border Gateway Protocol) An inter-autonomous system routing protocol. BGP is based on a routing method called path vector routing. Path vector routing is different from both distance vector routing and link state routing. Each entry in the routing table contains the destination network, the next router, and the path to reach the destination. Table 4.1 Path vector routing table

  36. 4.4 PACKETIZING: IP PROTOCOL

  37. Figure 4-11 Position of IP in Internet model • The Internet Protocol(IP) is the transmission mechanism used by the TCP/IP protocols. • IP is an unreliable and connectionless datagram protocol-a best-effort delivery service. • The term bet-effort means that IP provides no error checking or tracking. • If reliability is important ,IP must be paired with a reliable protocol such as TCP.

  38. Figure 4-12 IP datagram format • Packets in the IP layer are called datagrams. • A datagram is a variable-length packet consisting of two parts: • header and data.

  39. Version Header length Differentiated service Total length Identification, flags, and fragmentation offset Time to live Checksum Protocol Source address Destination address Technical Focus:Fields in a Datagram The fields in a datagram are as follows:

  40. 4.5 FRAGMENTATION

  41. MTU: Maximum Transfer Unit Fragmentation is done by the source host or routers in the path. Reassembly of datagram is done by the destination host. Defining a fragment Datagram id Last datagram flag offset

More Related