1 / 76

Computer Networks

Computer Networks Chapter 5 Network Layer 2 Prof. Jerry Breecher CSCI 280 Spring 2002 The Weeks Ahead Mar 11 Chapter 5.1: Network Layer Mar 13 Chapter 5.1 Mar 18 EXAM 2 Mar 20 Chapter 5.1:

adamdaniel
Download Presentation

Computer Networks

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. Computer Networks Chapter 5 Network Layer 2 Prof. Jerry Breecher CSCI 280 Spring 2002

  2. The Weeks Ahead Mar 11 Chapter 5.1: Network Layer Mar 13 Chapter 5.1 Mar 18 EXAM 2 Mar 20 Chapter 5.1: Mar 21 LAB – You should have several tests running. Mar 25 Chapter 5.2: More Network Layer Mar 27 Chapter 5.2: Apr 1 Chapter 5.2 Apr 3 Chapter 6.1: Transport Layer Apr 8 Chapter 6.1: Apr 10 EXAM 3 Apr 15 Chapter 6.1: Apr 17 Chapter 6.1: Apr 22 Chapter 6.1: Apr 24 Chapter 6.1: Apr 25 LAB – Drop Dead Date!! May 3 Final Exam – 8:00 – 10:00 Chap. 5- Net2

  3. Chapter Overview The Network Layer is concerned about getting packets from source to destination, no matter how many hops it may take. It’s all about routing. 5.1 Network Layer Design Issues What do we need to think about in this layer? 5.2 Routing Algorithms Strategies for getting from source to destination. 5.3 Congestion Control Algorithms How do we keep from bottlenecking from too many packets? 5.4 Internetworking Working with multiple networks and protocols in order to deliver packets. 5.5 The Network Layer in the Internet Gluing together a collection of subnets. Chap. 5- Net2

  4. Overview Internetworking • Getting various networks to all play together. • Problems occur because: • Companies don’t have cohesive policies for networking. • New technology replaces some of the old technology. 5.1 Network Layer Design Issues 5.2 Routing Algorithms 5.3 Congestion Control Algorithms 5.4 Internetworking 5.5 The Network Layer in the Internet Chap. 5- Net2

  5. Overview Internetworking Reminder: The Internet is a homogeneous collection of networks, all using TCP/IP and associated protocols. The internet, the more generic term, is made up of a hodgepodge of different hardware and protocols. Multiple networks and multiple network types are a fact of life: There are a number of reasons for this: • Growth: Individual departments in a university buy LANs for their own machines and eventually want to interconnect with other campus LANs. • Fault isolation, geography, and security: Even when feasible to use one network, an organization can obtain exclusive control over a single local network. • Control: Some organizations want to be able to say what happens on their network. • Modernization: As new technology appears, some organizations replace their networks while other’s don't. Chap. 5- Net2

  6. Overview Internetworking An example of mixing together multiple types of networks. Chap. 5- Net2

  7. Overview Internetworking Internetworking deals with the issues of interconnecting multiple networks. Physical networks can be connected at several levels: • Repeaters operate at the physical layer (layer 1), copying signals from one LAN to another. They operate at the bit level, and have no notion of what the bits (or even frames!) mean. • Bridges operate at the data link layer (layer 2), copying frames from one LAN to another. • They perform store-and-forward packet switching, but use only level-2 (e.g. frame fields) information. • We've talked about these before in regard to the MAC layer, where we looked at spanning tree and source routing methods. • Routers operate at the network layer (level 3). • Similar to bridges in concept. • At the network layer, they are fully aware of different network technologies, and can problems as interconnect different between them. • Transport gateways connect two networks at the transport layer (level 4). • Application gateways operate at higher levels (level “7”). Application gateways can translate between OSI mail and SMTP (Internet) mail formats, for instance. Chap. 5- Net2

  8. Overview Internetworking Router Ownership One issue that arises with Routers is who owns them. • Typically, bridges connect LANs of one organization, and so ownership is not an issue. • The ownership question is important for routers because someone has to be responsible for the router's operation and dual ownership frequently leads to finger pointing when something goes wrong. • One solution is to use half gateways. • If two countries are involved, for instance, each country owns its half of the router, with a wire separating the two. • A special protocol operates over the wire, and each half of the router is responsible for implementing the protocol. • For example, the CCITT X.75 standard is used to connect half gateways in connection-oriented networks. The reality isn't so simply layered - many products combine bridge and router functionality. Chap. 5- Net2

  9. How Networks Differ Internetworking We've looked at some of these properties before, but here are a list of differences: Item Some Possibilities Service OfferedConnection-oriented versus connectionless Protocols IP, IPX, CLNP, Appletalk, DecNet, . . . . Addressing Flat (802) versus hierarchical (IP) Multicasting Present or absent (also broadcasting) Packet Size Every network has its own max Quality of Service May be present or absent - many different kinds Error Handling Reliable, ordered, and unordered delivery Flow control Sliding window, rate control, other, none Congestion Control Leaky bucket, choke packets, etc. Security Privacy rules, encryption, etc. Parameters Different timeouts, flow specs, etc. Accounting By connect time, by packet, by byte, or none Chap. 5- Net2

  10. Multiprotocol Routers Internetworking Can use "routers" and "gateways" interchangeably or think of routers as within a subnet (same network) versus gateways (between subnets). Text calls gateways multi-protocol routers. Protocol Routers are packet switches that operate at the network layer (level 3). Operating at the network level gives routers increased flexibility compared to bridges in terms of: • Translating addresses between dissimilar networks. • Fragmenting large packets for transmission across networks that carry only small maximum packet lengths. • Selecting an appropriate path through the subnet. • Enforcing policies (e.g., don't forward any local packets off of this network). Because routers do more work than bridges, they generally run slower than bridges. Chap. 5- Net2

  11. Concatenated Virtual Circuits Internetworking Internetworking in a connection-oriented environment operates essentially as in the single network case: • The sending host opens a virtual circuit as before, but now a circuit goes through router hops. • Any two neighboring routers at the internetworking level must be connected to a common network. • Regular router-based virtual circuits connect neighboring routers on the same physical network. • The end-to-end virtual circuit is a concatenation of individual virtual circuits through each of the networks along the path. So each gateway/router maintains tables for each of the connections passing through it - what router to pass the packet on to, and an identifier for the virtual circuit. Chap. 5- Net2

  12. Connectionless Internetworking Internetworking Connectionless internets operate just as connectionless networks. • A host sends a packet to a neighboring router, which forwards it the next router, and so forth. • Just as with connectionless networks, routers make only a best-effort attempt at delivering the packet. Datagrams The Network layer puts datagrams on the subnet. See Figure 5.37 Issues that must be dealt with: • Networks with different networks protocols are tough to translate between. This is rarely attempted. (See tunneling below.) • Addressing - when adjacent networks have differing address schemes, the going gets tough. Again, problems are generally insurmountable. Chap. 5- Net2

  13. Connectionless Internetworking Internetworking Chap. 5- Net2

  14. Tunneling Internetworking Tunneling is a special case between two same-type networks across intervening foreign network(s). • The whole packet is encapsulated in the protocol of the foreign network to be crossed, and then restored on the other side. See Figure 5.38 • This avoids, totally, trying to translate the packet. Chap. 5- Net2

  15. Fragmentation Internetworking How to cross networks whose maximum transmission unit (MTU) is smaller than the packet being transmitted. • Connection-oriented internets avoid this problem. • By selecting a maximum packet size at connection set up time. • That maximum is just min( MTU1, MTU2, ...) of the MTUs in the intervening network. • Once the connection is established, the path never changes, so the sender can select a packet size and never again worry that it will be too large. • In connectionless internets, the appropriate packet size depends on the path used. • Thus, it can change at any time. In the general case, setting a minimum MTU for all networks is impractical. A minimum MTU would of necessity be small, yet sending larger packets should be encouraged for efficiency reasons. Solutions: • Have router drop packets that are too large to send across a network and return an error message to the sender. The sending host could then retransmit the data in a smaller packet. • Have router fragment large packets into several fragments, each small enough to traverse the network. There are two flavors called Transparent and non-Transparent Fragmentation. Chap. 5- Net2

  16. Fragmentation Internetworking Transparent Fragmentation With transparent fragmentation, end hosts (sender and receiver) are unaware that fragmentation has taken place. A router fragments a packet, and the next-hop router on the same network reassembles the fragments back into the original packet. Drawbacks are: • All fragments must travel through to the same router. They must all be reassembled by the same next-hop router • Routers must be careful to avoid re-assembly lockup. (The deadlock problem discussed earlier, where a router has used up all of its buffer space to hold fragments and can no longer accept new ones). • Reassembling fragments uses precious router resources that could otherwise be used forwarding packets). • May fragment/re-assemble several times along the route! Chap. 5- Net2

  17. Fragmentation Internetworking Non-Transparent Fragmentation: As before, routers fragment packets when needed. Routers along the path do not reassemble. Destination hosts perform re-assembly (if needed). Downsides are: • Now every host must be prepared to do this job. • Overhead of carrying along small segments lasts until destination. Problems Associated With Fragmentation in General: • Fragmenting increases waste: the sum of the bits of the individual fragments exceeds the number of bits in the original message. • Loss of a single fragment requires an end-to-end retransmission; the loss of a single fragment has the same effect as losing the entire packet. • More work to forward three small packets than one large one. The cost of forwarding packets includes a fixed per-packet cost, that includes doing the route lookup, fielding interrupts, etc. Chap. 5- Net2

  18. Firewalls Internetworking Require all network traffic to/from organization to go through a single point (firewall). The firewall has: • Packet filters • Application Gateway • Proxy Server Packet Filters: A router that inspects packets according to a set of rules. Rules generally consist of tables detailing what: • remote machines can be communicated with. • ports can be accessed. Since functionality is associated with ports, incoming requests to port 79 (Finger) could be blocked. Users could be prevented from telneting into the company, instead going through a modem with additional password protection. Chap. 5- Net2

  19. Firewalls Internetworking Application Gateway: Actually looks at content - mail handler might reject spams, very large messages, “lurid” words, etc. Editorial: If you allow the Internet on your site, you have only modest hope of real security. Proxy Server: • Works as an intermediary between a browser and an database/FTP/etc. server. • This Proxy Server translates between HTTP and FTP for instance. • Keeps browser from having to know many protocols. • Can cache previously requested pages. Within a firewall: • A local browser talks to the local proxy server (within the firewall.) • That Proxy contacts remote sites and fetches pages. • This fetching can be selective (protecting schoolkids, etc.) Chap. 5- Net2

  20. Overview Network Layer In The Internet This section is TCP specific It’s how the Internet works. Defined by RFC 791. Most Popular Layer 3. 5.1 Network Layer Design Issues 5.2 Routing Algorithms 5.3 Congestion Control Algorithms 5.4 Internetworking 5.5 The Network Layer in the Internet Chap. 5- Net2

  21. The IP Protocol Network Layer In The Internet The Internet protocol suite covers (mostly) layers 3, 4, and 5, where ‘layer 5' means everything in OSI layers 5-7. At the physical and datalink layers, the TCP/IP protocols don't define any standards. The protocols have been designed to operate over a large number of layer 2 protocols. The Internet Protocol (IP) is a network layer protocol. • Hosts and gateways process packets called Internet datagrams (IP datagrams). • IP provides connectionless, best-effort delivery service to the layers above it. The Transmission Control Protocol (TCP) is a transport layer protocol. • Provides reliable stream service between processes on two machines. • It is a sliding window protocol that uses acknowledgments and retransmissions to overcome the unreliability of IP. The Universal Datagram Protocol (UDP) is a Transport Layer Protocol. • It provides connectionless datagram service between processes. Chap. 5- Net2

  22. The IP Protocol Network Layer In The Internet Application protocols include: SMTP: The Simple Mail Transfer Protocol is used to send mail from one machine to another. SNMP: The Simple Network Management Protocol provides monitoring and managing capabilities for a network. Telnet: Provides remote login service. It allows a user on one machine to log into another machine on the network. FTP: The File Transfer Protocol copies arbitrary files (e.g. binary, data, and source) from one machine to another. SSH, RLOGIN, RSH: Methods for logging on to a remote machine. Chap. 5- Net2

  23. The IP Protocol Network Layer In The Internet Network Byte Order One problem that often arises is that different machines represent integers in different ways: Big Endian machines such as IBM and Sun-3 computers store the most significant byte of a 32-bit integer in the lowest memory address of the word (e.g. to the left). • The integer 0x01020304 is laid out in memory as bytes 0x01, 0x02, 0x03, and 0x04. Little Endian machines such as the Intel Processor store the most significant byte at the highest address. • The integer 0x01020304 is laid out in memory as bytes 0x04, 0x03, 0x02, 0x01. Other machines (such as DEC-10s) use 36-bit words to hold integers. As with all network protocols, the standards specify the meanings of all bits in each field, right down to the bit and byte order. The Internet defines a network Big Endian standard byte order that is used when referring to the fields of Internet datagrams. Chap. 5- Net2

  24. The IPV4 Protocol Network Layer In The Internet INTERNET PROTOCOL (IP) The goal of IP is to interconnect networks of diverse technologies and create a single, virtual network to which all hosts connect. Hosts communicate with other hosts by handing datagrams to the IP layer; • The sender doesn't worry about the details of how the networks are actually interconnected. • IP provides unreliable, connectionless delivery service. • IP defines a universal packet called an Internet Datagram. All Internet hosts and gateways process IP datagrams. Chap. 5- Net2

  25. The IPV4 Protocol Network Layer In The Internet 1. Version number (4-bits): • The current protocol version is 4. • Including a version number allows a future version of IP be used along side the current version, facilitating migration to new protocols. 2. Header length (4-bits): • Length of the datagram header (excluding data) in 32-bit words. • The minimum length is 5 words = 20 bytes, but can be up to 15 words if options are used. • In practice, the length field is used to locate the start of the data portion of the datagram. Chap. 5- Net2

  26. The IPV4 Protocol Network Layer In The Internet 3. Type-of-service (8-bits): A hint to the routing algorithms as to what type of service we desire. Precedence (3-bits): A priority indication, where 0 is the lowest and means normal service, while 7 is highest and is intended for network control messages (e.g., routing, congestion control). Delay (1-bit): An Application can request low delay service (e.g., for interactive use). Throughput (1-bit): Application requests high throughput. Reliability (1-bit): Application requests high reliability. Note: These last three TOS bits will generally be mutually exclusive. Does setting the low-delay bit guarantee getting such service? No. The type-of-service field is meant as a request or hint to the routing algorithms, but does not guarantee that your request can be honored (e.g., there may not be a low-delay path available). In practice, routers ignore the TOS field in IPV4. Chap. 5- Net2

  27. The IPV4 Protocol Network Layer In The Internet 4. Total length (16-bits): Total length of the IP datagram (in bytes), including data and header. The size of the data portion of the datagram is the total length minus the size of the header. Chap. 5- Net2

  28. The IPV4 Protocol Network Layer In The Internet 5 - 8. Identification (16-bits), Flags (3-bits), Fragment offset (13-bits): These three fields are used for fragmentation and reassembly. • Gateways along a path are free to fragment datagrams as needed; hosts are required to reassemble fragments before passing complete datagrams to the higher layer protocols. • Each fragment contains a complete copy of the original datagram header plus some portion of the data. • A receiving host must match arriving fragments with the proper original datagram. • These fragments may be out of order and interleaved with other fragments. • All fragments of a datagram will have the same source and destination IP address. • But, other datagrams between those two machines will share these fields as well, so this is not enough. Chap. 5- Net2

  29. The IPV4 Protocol Network Layer In The Internet 5 - 8. Identification (16-bits), Flags (3-bits),Fragment offset (13-bits) (Continued): The identification field uniquely identifies fragments of the same original datagram. Whenever a host sends a datagram, it sets the identification field of the outgoing datagram and increments its local identification counter. The offset field shows order of the fragments. When a gateway fragments a datagram, it sets the offset field of each fragment to reflect at what data offset with respect to the original datagram the current fragment belongs. Fragmentation occurs in 8-byte chunks, so the offset holds the “chunk number”. Gateways can further fragment fragments! A 400-byte fragment having an offset of 300 chunks could be split into two 200-byte fragments having offsets of 300 and 325 chunks, respectively. Chap. 5- Net2

  30. The IPV4 Protocol Network Layer In The Internet We need to know when we’ve received all of the fragments. To help with this, the flags field may contain: A Don't Fragment indication (set by host, honored by gateways). (A 1-bit flag.) The More Fragments field indicates that another fragment follows this one. This fragment is not the last fragment of the original datagram. An unfragmented datagram has an offset of 0, and a More Fragment bit of 0. The last fragment of a fragmented datagram contains More Fragment = Clear and the Offset non-zero. Note: The total length field of the IP header refers to the current datagram, not the original. Thus, the More Fragment bit is needed in order for the recipient host to determine when it has all fragments of a datagram. Chap. 5- Net2

  31. The IPV4 Protocol Network Layer In The Internet 5 - 8. Identification (16-bits), Flags (3-bits),Fragment offset (13-bits) (Continued): Example: Original Frame: IHL = 5, Length = 656, Fragment Offset = 0, More = 0 Fragment 1: IHL = 5, Length = 252, Fragment Offset = 0, More = 1 Fragment 2: IHL = 5, Length = 252, Fragment Offset = 29, More = 1 Fragment 3: IHL = 5, Length = 192, Fragment Offset = 58, More = 0 Chap. 5- Net2

  32. The IPV4 Protocol Network Layer In The Internet 9. Time-to-live (8-bits): • A counter that is decremented by each gateway. • Should this hopcount reach 0, discard the datagram. • Originally, the time-to-live field was intended to reflect real time. • In practice, it is now a hopcount. • The time-to-live field squashes looping packets. • It also guarantees that packets don't stay in the network for longer than 255 seconds, a property needed by higher layer protocols that reuse sequence numbers. 10. Protocol (8-bits): • What type of data the IP datagram carries (e.g., TCP, UDP, etc.). • Needed by the receiving IP to know the higher level service that will next handle the data. Chap. 5- Net2

  33. The IPV4 Protocol Network Layer In The Internet 11. Header Checksum (16-bits): A checksum of the IP header (excluding data). The IP checksum is computed as follows: • Treat the data as a stream of 16-bit words (appending a 0 byte if needed). • Compute the 1's complement sum of the 16-bit words. Take the 1's complement of the computed sum. This checksum is much weaker than the CRCs we have studied. But, it has the property that the order in which the 16-bit words are summed is irrelevant. We can place the checksum in a fixed location in the header, set it to zero, compute the checksum, and store its value in the checksum field. On receipt of a datagram, the computed checksum calculated over the received packet should be zero. Check summing only the header reduces the processing time at each gateway, but forces transport layer protocols to perform error detection (if desired). The header must be recalculated at every router since the time_to_live field is decremented. Chap. 5- Net2

  34. The IPV4 Protocol Network Layer In The Internet 12. Source address (32-bits): Original sender's address. This is an IP address, not a MAC address. 13. Destination address (32-bits): Datagram's ultimate destination. Note: When a gateway forwards a frame to another gateway, it forwards an Ethernet frame. The IP embedded datagram contains the source of the original sender (not the forwarding gateway) and the destination address of the ultimate destination. Chap. 5- Net2

  35. The IPV4 Protocol Network Layer In The Internet 14. IP Options IP datagrams allow the inclusion of optional, varying length fields that need not appear in every datagram. We may sometimes want to send special information, but we don't want to dedicate a field in the packet header for this purpose. Options start with a 1-byte option code, followed by zero or more bytes of option data. The option code byte contains three parts: copy flag (1 bit): If 1, replicate option in each fragment of a fragmented datagram. That is, this option should appear in every fragment as well. If 0, option need only appear in first fragment. option class (2 bits): Purpose of option: 0 = network control 1 = reserved 2 = debugging and measurement 3 = reserved option number (5 bits): A code indicating the option's type. See Figure 5.46 for these. Chap. 5- Net2

  36. IPV4 Addresses Network Layer In The Internet In the Internet, names consist of human-readable strings such as osborne, babbage, or jbreecher@clarku.edu or jb@sw.stratus.com. Addresses consist of compact, 32-bit identifiers. Internet software translates names into addresses and addresses into names; lower protocol layers always uses addresses rather than names. Internet addresses are hierarchical, consisting of two parts: • network: The network part of an address identifies which network a host is on. Conceptually, each LAN has its own unique IP network number. • local: The local part of an address identifies which host on that network. We'll look at subnets that add a third level to the hierarchy. With subnetting, the local part may consist of a `site'), which is further broken down into local network number, local host. The Internet consists of a collection of physical networks, each of which is assigned a unique number. The network number is used to route between gateways. Only the gateway on the same network as the destination uses the local part of the address in forwarding a datagram. Analogy: Zip codes get a letter to the local post office, the address takes it from the post office to your house. Chap. 5- Net2

  37. IPV4 Addresses Network Layer In The Internet Address Classes The Internet designers were unsure whether the world would evolve into a few networks with many hosts (e.g., large networks), or many networks each supporting only a few hosts (e.g., small networks). Thus, Internet addresses handle both large and small networks. Internet address are four bytes in size, where: Class A addresses start with a `0' in the most significant bit, followed by a 7-bit network address and a 24-bit local part. Class B addresses start with a `10' in the two most significant bits, followed by a 14-bit network number and a 16-bit local part. Class C addresses start with a `110' in the three most significant bits, followed by a 21-bit network number and an 8-bit local part. Class D addresses start with a `1110' in the four most significant bits, followed by a 28-bit group number. Used for multicast. Class E addresses start with a ‘11110’ and are reserved for future use. Chap. 5- Net2

  38. IPV4 Addresses Network Layer In The Internet Chap. 5- Net2

  39. IPV4 Addresses Network Layer In The Internet Address Classes The use of fixed-sized IP addresses makes the routing operation efficient. In the ISO world, addresses are of varying format and length and extracting the address from the packet may not be straightforward. Registration of addresses is through the NIC (Network Information Center.) See Figure 5.48 for the use of special addresses. Chap. 5- Net2

  40. IPV4 Addresses Network Layer In The Internet Address Classes Sample addresses can be obtained by using gethostbyname. 1998 Addresses2002 Addresses garden.wpi.edu 130.215.8.145 (class B) 130.215.28.200 (class B) wpi.edu: 130.215 (a network addr) 130.215.24.6 gwen.cs.purdue.edu: 128.10.3.8 (class B) eznet.net: 198.70.51.10 (Class C) 209.105.128.10 home.eznet.net 205.247.58.99 (Class C) stanford.edu: 36.56.0.10 (class A) breecher.net 216.168.224.70 clark.edu 192.102.5.4 babbage.clarku.edu 140.232.101.102 osborne.clarku.edu 140.232.101.115 (Class ?) www.microsoft.com 207.46.197.102 207.46.197.113 207.46.230.218 207.46.230.219 207.46.230.220 207.46.197.100 Chap. 5- Net2

  41. IPV4 Addresses Network Layer In The Internet Address Classes Note: Internet addresses refer to network connections rather than hosts. • Gateways, for instance, have two or more network connections and each interface has its own IP address. • There is not a one-to-one mapping between host names and IP addresses. Internet addresses are hierarchical addresses. • Datagrams are initially routed only by network number. • Only the gateway connected to the destination network uses the local part while performing the routing operation. What happens to a host's internet address if that host moves from one network to another? • Its Internet address must change. • It’s important to distinguish between a machine's name and its address. • Physical (ethernet) address is constant, network (IP) address may change. Chap. 5- Net2

  42. Subnets Network Layer In The Internet This usage of “Subnets” is different from that we used before to define the routers and lines in a network. Goals: • We want to be able to reduce the number of networks seen by the outside world; • We want to simplify the management of those many networks within the organization; • We want to be able to slice the network/node “pie” in various ways. • A large organization or campus might have 30 or more LANs (one for each department). • An organization will probably have only a single connection to the rest of the Internet. • In order for every local host to be able to communicate with other Internet machines, routing entries for each of the 30 networks must exist in the core gateways. • In order for other sites to be able to respond to our queries, they must be able to route packets back to us. • Wouldn't it be nice if we only needed to advertise a single network number for all 30 networks? The Answer: • Subnet addressing is a technique that allows a set of multiple, interconnected networks to be covered by a single IP network number. • IP addresses have a well-defined structure that allows a gateway to extract the network portion of an address by simply looking at its class and an optional netmask. Chap. 5- Net2

  43. Subnets Network Layer In The Internet With subnetting, the local part of an IP address is further subdivided into a network and a host part: Consider two addresses 128.204.2.29 and 128.204.3.109. Are they on the same network? NO. • They refer to hosts on the same network address (128.204), but they can actually be on different ethernets connected by a bridge. • To do this, we divide the local part (the two bytes to the right of 128.204) into a 1-byte network part and a 1-byte host part. • When sending data to 128.204.3.109 local gateways first route datagrams to the (sub)network 128.204.3 rather than (IP network) 128.204. • 128.204.2 and 128.204.3 are distinct (sub)networks. • To the outside world, there is only a single network 128.204. • Each of the individual networks is called a subnet. Chap. 5- Net2

  44. Subnets Network Layer In The Internet With subnetting, the local part of an IP address is further subdivided into a network and a host part: Consider two addresses 128.204.2.29 and 128.204.3.109. Are they on the same network? YES. • They refer to hosts on the same network address (128.204), but they can actually be on the same ethernet. • To do this, we divide the local part (the two bytes to the right of 128.204) into a 7-bit network part and a 9-bit host part. • Our example above is a Class B address; the technique applies also to Classes A and C. Chap. 5- Net2

  45. Subnets Network Layer In The Internet To implement subnetting, hosts and gateways use a subnet mask to extract the network part of an IP address. This mask can be seen in Figure 5.49. In this example, 6 bits are reserved for subnet, and 10 bits for host. To distinguish between direct (the router knows how to get to the destination) and indirect (the router sends the packet off for someone else to figure it out) routing, Without subnets, a router has tables of the form: (other_network, 0) and (this_network, host). With subnets, a router has tables of the form: (this_network, subnet, 0) and (this_network, this_subnet, host). Chap. 5- Net2

  46. Subnets Network Layer In The Internet • Determining the subnetwork number of a network interface: • Each network interface has a subnet mask. • The subnet mask ANDed with the interface address yields the network number of the interface. • For each of the machine's interface ports (hosts usually have only one, routers have many): • Extract the destination address DEST from the datagram. • If ( ( port_interface_address & subnet_mask ) == ( DEST & subnet_mask ) ), direct routing with this port can be used. The routing algorithms described earlier remain essentially the same when subnetting is in use. • Routing algorithms may need to propagate the mask with a network number in routing updates. • They need the mask to extract (sub)network numbers. • Subnetting extends the number of levels in the Internet's hierarchical routing scheme. • It trades off optimality of routes vs. table space in gateways. Host can find out its mask: Host sends ICMP address mask requests; responses contain the mask for the local network. Chap. 5- Net2

  47. Subnets Network Layer In The Internet Chap. 5- Net2

  48. Subnets Network Layer In The Internet Chap. 5- Net2

  49. Internet Control Protocols Network Layer In The Internet INTERNET CONTROL MESSAGE PROTOCOL (ICMP) The Internet Control Message Protocol (ICMP) allows gateways and hosts to send network control information to each other. From a layering point of view, ICMP is a separate protocol that sits above IP and uses IP to transport messages. In practice, ICMP is an integral part of IP and all IP modules must support the ICMP protocol. ICMP datagrams are encapsulated within IP datagrams and processed by IP in the same way as TCP and UDP datagrams; if special processing is needed, the IP type-of-service (TOS) field could be used. Transport TCP/UDP IP ICMP Chap. 5- Net2

  50. Internet Control Protocols Network Layer In The Internet INTERNET CONTROL MESSAGE PROTOCOL (ICMP) There are two general types of ICMP messages: Information messages, where a sender sends a query to another machine (either host or gateway) and expects an answer. For example, a host might want to know if a gateway is alive. Error indication messages, where the IP software on a host or gateway has encountered a problem processing an IP datagram. For example, it may be unable to route a datagram to its destination, or it may have had to drop a frame. There are a number of message types of which we will talk about only a few: Transport TCP/UDP IP ICMP Chap. 5- Net2

More Related