Presentation is loading. Please wait.

Presentation is loading. Please wait.

Notes and Handouts The Network Layer in the Internet

Similar presentations


Presentation on theme: "Notes and Handouts The Network Layer in the Internet"— Presentation transcript:

1 Notes and Handouts The Network Layer in the Internet
November 14, 2018 Computer Networks 2 The Network Layer in the Internet November 14, 2018 Veton Këpuska Veton Këpuska

2 The Network Layer in the Internet
At the Network Layer Internet can be viewed as collection of sub-networks or Autonomous Systems (ASes). Properties: There is no real structure, Various Network components held together via a number of Backbones. High-bandwidth lines, and Fast Routers Regional Networks are attached to those backbones. University LAN’s, Company LAN’s, and Internet Providers are connected to Regional Networks. A sketch of quasi-hierarchical organization of the Internet is depicted in following figure: November 14, 2018 Veton Këpuska

3 The Network Layer in the Internet
The Internet is an interconnected collection of many networks November 14, 2018 Veton Këpuska

4 The Network Layer in the Internet
Network Layer Protocol is the glue that holds the whole Internet together. This protocol is called IP (Internet Protocol). IP: Is designed from the beginning with internetworking in mind. Its job is to provide: A best-effort (i.e., not guaranteed) way to transport datagrams from source to destination. Connectivity in spite the fact these machines can be on the same network or there are other networks in between them. November 14, 2018 Veton Këpuska

5 The Network Layer in the Internet
Communication in the Internet: The transport layer takes data streams and breaks them up into datagrams. Datagrams can be up to 64 Kbytes each, but in practice they usually are not more than 1500 bytes (they fit in one Ethernet frame). Each datagram is transmitted through the Internet, possibly being fragmented into smaller units. In the destination machine they are reassembled by the network layer into the original datagram. This datagram is handed over to transport layer. In the previous sketch an example can be depicted where the packet originating at host 1 has to traverse six networks to get to the destination host 2. Note that in practice it takes much more then six. November 14, 2018 Veton Këpuska

6 The IP Protocol Format of datagrams is a starting point to study the network layer in the internet: IP datagram consists of: Header, and Text part. Header: 20-byte fixed part Variable length optional part. Header format: November 14, 2018 Veton Këpuska

7 The IP Protocol Transmitted in Big-Endian format: bit order is from left-to-right, with the high order bit of the Version field proceeding the rest. (Note Motorola uses big-endian order while Intel little-endian order). Conversion is required on all little-endian machines in transmission and reception. Version field keeps track of which version of the protocol the datagrams are using. Due to variability of the header size, a field header, IHL, is provided to specify the length of the header in 32 bit (4 bytes) words. Minimal value of IHL is 5 (no options present) Maximal value of IHL is 15 (limits the header to 15*4 bytes = 60 bytes => Options field length = 40 bytes). Note that for some options, for example one that records the route a packet has taken, 40 bytes is not nearly enough, thus making this option useless. November 14, 2018 Veton Këpuska

8 The IP Protocol The Type of Service:
It is intended to specify different classes of service: Various combinations of reliability and speed are possible. Examples: Digitized voice: fast delivery dominates over accurate delivery. File transfer: error-free transmission is more important then fast transmission. It is contained in the field of 6 bits: First three bits (from left to right) specify Precedence filed, and Three flags: D, T, and R. Precedence field specifies priority (0-7). Flag bits allowed the host to specify what requirements are most important ( Delay, Throughput, or Reliability Theoretically those flags and Precedence level would allow routers to make choices between for example: Satellite link with high throughput and high delay, and Leased line with low throughput and low delay. In practice routers ignore type of service field all together. November 14, 2018 Veton Këpuska

9 The IP Protocol IETF (Internet Engineering Task Force) allowed slight change in the usage/definition of Type of Service field. Six bits are now used to indicate which of the service classes discussed earlier each packet belongs to. Total length field includes everything in the datagram: Header + Data. Maximum length 216 = 65,535. Future gigabit networks will require larger datagrams. Identification field is needed to allow the destination host to determine which datagram a newly arrived fragment belongs to. All fragments of the same datagram contain identical identification field value. November 14, 2018 Veton Këpuska

10 The IP Protocol DF – Don’t Fragment field. It is used to indicate to the router not to fragment the datagram when destination can not put the datagram together from received fragments . MF – More Fragment field. All fragments with exception to the last one have this bit set. It is used to indicate when the last fragment of a datagram has arrived. Fragment Offset. Specifies where this fragment belongs in the datagram. All fragments except the last one in a datagram must be a multiple of 8 bytes (elementary fragment unit). 13 bits => max of 8192 fragments per datagram. Time to Live. Limits packets lifetime. It is supposed to count time in seconds, allowing a maximum lifetime of 255 sec. In practice it just counts hops. When it hits zero the packet is discarded and a warning packet is sent back to the source host. November 14, 2018 Veton Këpuska

11 The IP Protocol Protocol Field:
When Network Layer has assembled a complete datagram it needs to know what to do with it. This field specifies which transport process to give it to: TCP (Transmission Control Protocol) UDP (User Datagram Protocol), etc. Numbering of protocols is global. Assigned numbers can be located at Header Checksum. Verifies the header only. Source Address and Destination Address. Indicate Network Number and Host number (more details later). Options Field. This field was designated to provide an escape to allow subsequent versions of the protocol to: Include information not present in the original design, Allow experimentation with and try outs of new ideas, and Avoid allocating header bits for the information that is rarely needed. Option Fields are variable length. Each begins with a: 1-byte code identifying the option. Followed by 1-byte option length with some options, and One or more data bytes. It is padded to a multiple of four bytes. Original options are given in the next table. Current complete and up-to-date list is available at November 14, 2018 Veton Këpuska

12 The IP Protocol Some of the IP options: November 14, 2018
Veton Këpuska

13 The IP Protocol Security. Strict Source Routing. Loose Source Routing.
In theory, a military router might sue this field to specify not to route through certain countries the military considers to be “bad guys”. In practice this field is ignored. Strict Source Routing. Gives the complete path from source to destination as a sequence of IP addresses. The datagram is required to follow that exact route. Loose Source Routing. Requires a packet to traverse the list of routers specified, and in the order specified. It is allowed to pass through other routers on the way. Useful to avoid certain countries. Record Route. Directs routers to append their IP address to the option field. When the ARPANET was first set up, no packet ever passed through more than nine router, so 40 bytes of option was ample. Now this size is to small. Timestamp. Directs routers to also record a 32-bit time stamp. This option is mostly for debugging. November 14, 2018 Veton Këpuska

14 IP Addresses Every Host and Router on the Internet has an IP address.
IP address encodes device work number and host number. I principle this combination should be unique; i.e., no two machines on the Internet should have the same IP address. IP addresses are 32 bits long. They are used in the Source address and Destination address fields of IP packets. IP address refers to a network interface and not to a host. If host is connected to two networks it must have two IP addresses. IP addresses were divided into five categories (see following figure). Depicted allocation has come to be called Classful Addressing. Note that it is no longer used but there may be numerous reference to it in literature. November 14, 2018 Veton Këpuska

15 IP Addresses IP Address Format November 14, 2018 Veton Këpuska

16 IP Addresses Class A, B, C and D formats allow for up to :
128 networks with 16 million host each 16384 networks with up to 64K hosts, or 2 million networks (e.g., LAN’s) with up to 256 host each. Class E, that has addresses that begin with 1111 is reserved for future use. Over 500,000 networks are now connected to the Internet, and the number grows every year. Network numbers are managed by a nonprofit corporation called ICANN (Internet Corporation for Assigned Names and Numbers) to avoid conflicts. ICANN has delegated parts of the address space to various regional authorities, which in turn give out IP addresses to ISPs and other companies. November 14, 2018 Veton Këpuska

17 IP Addresses Network addresses are typically written in dotted decimal notation. In this format each of the 4 bytes is written in decimal from 0 to 255. Lowest IP address: and highest is Values 0 and -1 (in signed binary notation, i.e., all 1’s) have special meanings as depicted in the following figure. 0 means this network or this host. -1 means all hosts on the indicated network. November 14, 2018 Veton Këpuska

18 IP Addresses IP address is used by hosts when they are being booted. The IP addresses with 0 as network number refer to the current network. This convention is used to allow machines to refer to their own network without knowing its number. However, they have to know its class to know how many 0’s to include. The address consisting of all 1s allows broadcasting on the local network, typically a LAN. The addresses with a proper network number and all 1s in the host field allow machines to send broadcast packets to distant LANs anywhere in the Internet. Note Network administrations can disable this feature. All addresses of the form 127.xx.yy.zz are reserved for loop back testing. Packets sent to that address are not put out onto the wire; they are processed locally and treated as incoming packets. November 14, 2018 Veton Këpuska

19 Subnets All host in a network must have the same network number.
This property of IP addressing can cause problems as networks grow. The problem is the rule that a single class A, B, or C address refers to one network, not to a collection of LANs. A small change was made to the addressing system to deal with this problem. Solution: allow a network to be split into several parts for internal use but still act like a single network to the outside world. Example of a typical University Campus Network: November 14, 2018 Veton Këpuska

20 Subnets A campus network consisting of LANs for various departments.
November 14, 2018 Veton Këpuska

21 Subnets In the literature, the parts of the network (in the example before Ethernets) are called subnets. This definition conflicts with “subnet” to mean the set of all routers and communication lines in a network. How does the main router know which subnet (Ethernet) to use to deliver a packet? Maintain a table that associates each host (in the campus) to its corresponding router. Problems: Large table (65,536 entries) Significant amount of manual maintenance in adding, moving, and removing hosts. Instead of having a single class B address with 14 bits for the network number and 16 bits for the host number, some bits are taken away from the host number to indicate subnet number. Example: University with 35 departments it could use 6-bit subnet number and a 10 bit host number allowing 26=64 Ethernets each with a maximum of 210-2=1022 hosts. To implement sub-netting, main router needs a subnet mask. It indicates the split between network + subnet number and host as shown in the next figure. November 14, 2018 Veton Këpuska

22 Subnet Mask Subnet masks are also written in dotted decimal notation, with the addition of a slash followed by the number of bits in the network + subnet part. In the example bellow subnet mask can be written as: Alternate notation is /22 to indicate that the subnet mask is 22 bits long. A class B network sub-netted into 64 subnets November 14, 2018 Veton Këpuska

23 Subnets Outside the network the sub-netting is not visible, so allocating a new subnet does not require contacting ICANN or changing any external databases. Following the same example one could use IP addresses for subnet: , and so on. In binary notation: | | | Note that “|” is used to indicate division of subnet number from host number. 6 bits to the right of | are subnet numbers and 10-bits to the right of | are host numbers. November 14, 2018 Veton Këpuska

24 Subnets Processing of IP packets (by a router).
Each router has a table listing: Some number of (network, 0) IP addresses, and Some number of (this-network, host) IP addresses. First kind contains information on how to get to distant networks Second kind tells how to get to local hosts. Associated with each table is the network interface to use to reach the destination. November 14, 2018 Veton Këpuska

25 Subnets When a packet arrives:
Its destination address is looked up in the routing table. If the packet is for a distant network – packet is forwarded to the next router as specified in the table. If it is a local host it is sent directly to the destination. If the network is not present, the packet is forwarded to a default router with more extensive tables. Each router thus has to keep track of other networks and local hosts and not (network, host) pars, thus reducing the size of the routing table significantly. November 14, 2018 Veton Këpuska

26 Subnets When sub-netting is introduced, the routing tables were changed by introducing entries of the form: (this-network, subnet, 0), and (this-network, this-subnet, host). Router on subnet k knows only how t get to all other subnets and also how to get to all the host on the subnet k. Thus it does not have to deal with the hosts on the other subnets. That is all that needs to be done is to have each router do a Boolean AN with the network's subnet mask to get rid of the host number and look up the resulting address in its tables. Example: packet addressed to: AND-ed with the subnet mask at the main router with the subnet mask /22 to give the address This address is looked up in the routing tables to find out which output line to use to get to the router for subnet 3. Subnetting reduces router table space by creating a three-level hierarchy consisting of network, subnet and host. November 14, 2018 Veton Këpuska


Download ppt "Notes and Handouts The Network Layer in the Internet"

Similar presentations


Ads by Google