Lecture 24 cn_aizaz

Lecture 24 cn_aizaz - •Data Communication and Networks 1...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: •Data Communication and Networks 1 The Network Layer in the Internet • The Internet Protocol • IP Addresses • Internet Control Protocols 2 Design Principles for Internet 1. Make sure it works. Do not finalize the design or standard until multiple Do not finalize the design or standard until multiple prototypes have successfully communicated with each other 1. Keep it simple. When in doubt, use the simplest solution When in doubt, use the simplest solution 1. Make clear choices. If there are several ways of doing the same thing, choose If there are several ways of doing the same thing, choose one 3 1. Exploit modularity. This principle leads directly to the idea of having protocol This principle leads directly to the idea of having protocol stacks, each of whose layers is independent of all the other ones So, if one module or layer is required to be changed, the So, if one module or layer is required to be changed, the other ones will not be affected 1. Expect heterogeneity. Different types of hardware, transmission facilities, and Different types of hardware, transmission facilities, and applications will occur on any large network. To handle them, the network design must be simple, To handle them, the network design must be simple, general, and flexible. 4 1. Avoid static options and parameters. If parameters are unavoidable (e.g., maximum packet size), If parameters are unavoidable (e.g., maximum packet size), it is best to have the sender and receiver negotiate a value than defining fixed choices. 1. Look for a good design; it need not be perfect. Often the designers have a good design but it cannot handle Often the designers have a good design but it cannot handle some weird special case Put the burden of working around it on the people with the Put the burden of working around it on the people with the strange requirements 5 1. Be strict when sending and tolerant when receiving. Only send packets that rigorously comply with the standards, Only send packets that rigorously comply with the standards, but expect incoming packets that may not be fully conformant and try to deal with them 2. Think about scalability. If the system is to handle millions of hosts and billions of If the system is to handle millions of hosts and billions of users effectively, no centralized databases of any kind are tolerable Load must be spread as evenly as possible over the Load must be spread as evenly as possible over the available resources. 3. Consider performance and cost. If a network has poor performance or outrageous costs, If a network has poor performance or outrageous costs, nobody will use it. 6 Internet – A collection of Subnetworks At the network layer, the Internet can be viewed as a collection of subnetworks or Autonomous Systems (ASes) that are interconnected. There is no real structure, but several major There is no real structure, but several major backbones exist. These are constructed from high­bandwidth lines and These are constructed from high­bandwidth lines and fast routers. Attached to the backbones are regional (midlevel) Attached to the backbones are regional (midlevel) networks, and attached to these regional networks are the LANs at many universities, companies, and Internet service providers 7 Collection of Subnetworks Internet is an interconnected collection of many networks 8 The glue that holds the whole Internet together is the network layer protocol, IP (Internet Protocol) Its job is to provide a best­efforts (i.e., not Its job is to provide a best­efforts (i.e., not guaranteed) way to transport datagrams from source to destination It does not care whether these machines are on the It does not care whether these machines are on the same network or whether there are other networks in between them. 9 Communication in the Internet The transport layer takes data streams and breaks them up into datagrams. In theory, datagrams can be up to 64 Kbytes each, In theory, datagrams can be up to 64 Kbytes each, but in practice they are usually not more than 1500 bytes (so they fit in one Ethernet frame). Each datagram is transmitted through the Internet, Each datagram is transmitted through the Internet, possibly being fragmented into smaller units as it goes. 10 When all the pieces finally get to the destination machine, they are reassembled by the network layer into the original datagram. This datagram is then handed to the transport layer, This datagram is then handed to the transport layer, which inserts it into the receiving process' input stream As shown in the figure, a packet originating at host 1 As shown in the figure, a packet originating at host 1 has to traverse six networks to get to host 2. In practice, it is often much more than six. In practice, it is often much more than six. 11 The IP Protocol In our study of the network layer in the Internet, we must discuss the format of the IP datagrams themselves. An IP datagram consists of a header part and a text An IP datagram consists of a header part and a text part. The header has a 20­byte fixed part and a variable The header has a 20­byte fixed part and a variable length optional part. It is transmitted in big­endian order: from left to right, It is transmitted in big­endian order: from left to right, with the high­order bit of the Version field going first. 12 IP Datagram Header Format IP protocol version number header length “type” of data (3­ Don’t (multiple of 4 bit Precedence Fragment bytes) and D T R) flag total datagram More length (bytes) Fragment including header flag 20­byte fixed part header (e.g. timestamp, record route taken, specify list of routers to visit) max number of remaining hops (decremented at each router) upper layer protocol to deliver payload to to which datagram this Fragment belongs to Fragment Number (multiple of 8 bytes if 13 not last) Version Field This field keeps track of which version of the protocol the datagram belongs to. By including the version in each datagram, it By including the version in each datagram, it becomes possible to have the transition between versions take years, with some machines running the old version and others running the new one. Currently a transition between IPv4 and IPv6 is going Currently a transition between IPv4 and IPv6 is going on, has already taken years, and is by no means close to being finished 14 IHL – Header Length Field Since the header length is not constant, a field in the header, IHL, is provided to tell how long the header is, in 32­bit words. The minimum value is 5, which applies when no The minimum value is 5, which applies when no options are present. The maximum value of this 4­bit field is 15, which limits the header to 60 bytes, and thus the Options field to 40 bytes. For some options, such as one that records the route For some options, such as one that records the route a packet has taken, 40 bytes is far too small, making that option useless. 15 Type of Service Field This field is used to distinguish between different classes of service. Originally, the 6­bit field contained (from left to right), Originally, the 6­bit field contained (from left to right), a three­bit Precedence field and three flags, D, T, and R. The Precedence field was a priority, from 0 (normal) The Precedence field was a priority, from 0 (normal) to 7 (network control packet). 16 The three flag bits allowed the host to specify what it cared most about from the set Delay Throughput Reliability In theory, these fields allow routers to make choices In theory, these fields allow routers to make choices between, for example, a satellite link with high throughput and high delay or a leased line with low throughput and low delay. In practice, current routers often ignore the Type of In practice, current routers often ignore the Type of service field altogether. 17 Total Length & Identification Fields The Total length includes everything in the datagram—both header and data. The maximum length is 65,535 bytes. The Identification field is needed to allow the The destination host to determine which datagram a newly arrived fragment belongs to. All the fragments of a datagram contain the same Identification value. 18 Don’t Fragment & More Fragment Fields Next comes an unused bit and then two 1­bit fields. DF stands for Don't Fragment. DF It is an order to the routers not to fragment the datagram because the destination is incapable of putting the pieces back together again. All machines are required to accept fragments of 576 bytes or less. MF stands for More Fragments. MF arrived. All fragments except the last one have this bit set. It is needed to know when all fragments of a datagram have 19 Fragment Offset Field This field tells where in the current datagram this fragment belongs. All fragments except the last one in a datagram must All fragments except the last one in a datagram must be a multiple of 8 bytes, the elementary fragment unit. Since 13 bits are provided, there is a maximum of Since 13 bits are provided, there is a maximum of 8192 fragments per datagram, giving a maximum datagram length of 65,536 bytes, one more than the Total length field. 20 Time to Live Field This field is a counter used to limit packet lifetimes. It is supposed to count time in seconds, allowing a It is supposed to count time in seconds, allowing a maximum lifetime of 255 sec. It must be decremented on each hop and is It must be decremented on each hop and is supposed to be decremented multiple times when queued for a long time in a router. In practice, it just counts hops. In practice, it just counts hops. When it hits zero, the packet is discarded and a When it hits zero, the packet is discarded and a warning packet is sent back to the source host. This feature prevents datagrams from wandering This feature prevents datagrams from wandering around forever. 21 Protocol Field When the network layer has assembled a complete datagram, it needs to know what to do with it. The Protocol field tells it which transport process to The give it to. TCP is one possibility, but so are UDP and some TCP is one possibility, but so are UDP and some others. The numbering of protocols is global across the The numbering of protocols is global across the entire Internet 22 Header Checksum Field The Header checksum verifies the header only. Such a checksum is useful for detecting errors Such a checksum is useful for detecting errors generated by bad memory words inside a router. The algorithm is to add up all the 16­bit halfwords as The algorithm is to add up all the 16­bit halfwords as they arrive, using one's complement arithmetic and then take the one's complement of the result. For purposes of this algorithm, the Header checksum For purposes of this algorithm, the Header checksum is assumed to be zero upon arrival. Note that the Header checksum must be recomputed Note that the Header checksum must be recomputed at each hop because at least one field always changes (the Time to live field). 23 Options Field The Source address and Destination address indicate the network number and host number The Options field allows subsequent versions of the The protocol to include information not present in the original design, to permit experimenters to try out new ideas The options are variable length. The options are variable length. Each begins with a 1­byte code identifying the option. Each begins with a 1­byte code identifying the option. 24 Originally, five options were defined 1. The Security option tells how secret the information is. 1. The Strict source routing option gives the The datagram is required to follow that exact route complete path from source to destination as a sequence of IP addresses. 25 1. The Loose source routing option requires the packet to traverse the list of routers specified, and in the order specified, but it is allowed to pass through other routers on the way path to append their IP address to the option field. routing algorithms 1. The Record route option tells the routers along the This allows system managers to track down bugs in the 1. Timestamp option is like the Record route option in This option, too, is mostly for debugging routing algorithms which each router also records a 32­bit timestamp. 26 ...
View Full Document

This note was uploaded on 12/18/2010 for the course ME 22 taught by Professor Rashid during the Spring '10 term at Superior University Lahore.

Ask a homework question - tutors are online