* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download IP address
Survey
Document related concepts
Network tap wikipedia , lookup
Distributed firewall wikipedia , lookup
Multiprotocol Label Switching wikipedia , lookup
Deep packet inspection wikipedia , lookup
IEEE 802.1aq wikipedia , lookup
Piggybacking (Internet access) wikipedia , lookup
Airborne Networking wikipedia , lookup
Internet protocol suite wikipedia , lookup
List of wireless community networks by region wikipedia , lookup
Computer network wikipedia , lookup
Wake-on-LAN wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Transcript
Chapter 4 Network Layer McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 OBJECTIVES After reading this chapter, the reader should be able to: Understand the position of the network layer in the Internet model. 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. Understand the network layer protocol, IP, used in the Internet. Know which upper-layer protocol can use the services of IP. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 4.1 INTRODUCTION McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Figure 4-2 McGraw-Hill Duties of the network layer ©The McGraw-Hill Companies, Inc., 2000 4.2 ADDRESSING McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Note: The network addresses must be unique. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 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 McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Two-Level Address: Network and Host 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Three-Level Address: Network, Subnetwork and Host • 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Figure 4-4 McGraw-Hill Three levels of hierarchy ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Note: A packet traveling from the source to the destination needs at least four addresses: source and destination port numbers and source and destination IP addresses. Application-layer address www.fhda.edu Transport-layer address46017,80(client and server port number) Network-layer address201.23.56.8,181.17.43.56(source and destination IP addresses) McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 • 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 4.3 ROUTING McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Routing • 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Figure 4-6 McGraw-Hill Example of portion of the Internet ©The McGraw-Hill Companies, Inc., 2000 • 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Figure 4-7 McGraw-Hill Routing decisions ©The McGraw-Hill Companies, Inc., 2000 Figure 4-8 McGraw-Hill Routing table for router R1 ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Note: Routing tables can be based on next-hop routing. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Size of routing table • Host-specific: each row is based on the host address. • Network specific: each row is based on the network address. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Autonomous systems • 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Figure 4-10 McGraw-Hill Autonomous systems ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 • 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 – 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 – 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 Network N01 N02 N03 N04 McGraw-Hill Next Router R01 R05 R06 R12 Path AS14,AS23,AS67 AS22,AS67,AS05,AS89 AS67,AS89,AS09,AS34 AS62,AS02,AS09 ©The McGraw-Hill Companies, Inc., 2000 4.4 PACKETIZING: IP PROTOCOL McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 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. McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 Technical Focus: Fields in a Datagram The fields in a datagram are as follows: Version Protocol Header length Checksum Differentiated service Source address Total length Destination address Identification, flags, and fragmentation offset Time to live McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 4.5 FRAGMENTATION McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000 • 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 McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000