chapter 2 internet protocol ip recommended reading comer vol 1 chapters 4 7 n.
Skip this Video
Loading SlideShow in 5 Seconds..
Chapter 2 Internet Protocol (IP) (Recommended reading: Comer, Vol 1, Chapters 4, 7) PowerPoint Presentation
Download Presentation
Chapter 2 Internet Protocol (IP) (Recommended reading: Comer, Vol 1, Chapters 4, 7)

Chapter 2 Internet Protocol (IP) (Recommended reading: Comer, Vol 1, Chapters 4, 7)

406 Views Download Presentation
Download Presentation

Chapter 2 Internet Protocol (IP) (Recommended reading: Comer, Vol 1, Chapters 4, 7)

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Chapter 2Internet Protocol (IP)(Recommended reading: Comer, Vol 1, Chapters 4, 7) • Internet Protocol (IP): • a protocol used in the internet layer. • IP makes use of the existing networks to deliver information, where these networks may use a variety of protocols. • IP Addresses • Hardware Address and Protocol Address • Each network adopts its own addressing scheme. • Different networks may adopt different hardware addresses with different sizes and different formats. • E.g, Ethernet address: 48 bits • When these networks are interconnected, there must be a uniform addressing scheme for all the computers and routers. • Each computer / router is assigned a unique protocol address. Dr. Y.W. Leung

  2. Remarks • Each computer has two addresses: • hardware address: used by the underlying network protocol; • protocol address: used by the internetworking protocols. • Hardware address is also known as physical address. • IP Addressing Scheme • Each computer / router is assigned a unique IP address having 32 bits. • Each IP address has two parts: • The prefix specifies the network to which the computer is attached. (network id or netid) • The suffix specifies a particular computer on a network. (hostid) • Problem • Given only 32 bits, how many bits should be allocated to the prefix and the suffix? • Considerations • If the prefix has many bits, the internet can accommodate many networks but each network can only have a few computers. • If the prefix has a few bits, the internet can only accommodate a few networks although each network can have many computers. Dr. Y.W. Leung

  3. The IP addressing scheme defines three primary classes, where each class has a distinct prefix/suffix size. (The Classful Addressing Scheme) • The internet can accommodate large networks, medium networks, and small networks. • Classes A, B, C are the primary classes. The IP addresses of computers and routers belong to these classes. • Class D is used for multicasting. When a packet is sent to an IP multicast address, all the computers sharing this address will receive this packet. Dr. Y.W. Leung

  4. In each primary class, the number of networks and the number of computers per network are as follows: • Each packet sent across the internet contains: • the IP address of the source, and • the IP address of the destination. • Dotted Decimal Notation • Commonly we use the dotted decimal notation to represent the 32-bit IP address. • more convenient for human to manipulate • Each octet (8-bit) is expressed as a decimal value, and adjacent decimal values are separated by a dot. • Example: Dr. Y.W. Leung

  5. The first decimal value defines the class of the IP address as follows: • Loopback address • 127.x.x.x • intended for use in testing TCP/IP and for inter-process communication on the local computer Dr. Y.W. Leung

  6. Assigning IP Addresses • Assigning Prefix Address • Each network must have a unique prefix address throughout an internet. • The prefix must be coordinated globally. • To connect a network to the global internet, an organization obtains a unique prefix address from the Internet Service Provider (ISP). • In turn, the ISP coordinates with a central organization (the Internet Assigned Number Authority (IANA, on or before 1998); the Internet Corporation for Assigned Names and Numbers (ICANN, after 1998)) to ensure the uniqueness of the prefix. • To connect a network to a private internet (Intranet), the organization can determine the prefix while ensuring its uniqueness. Dr. Y.W. Leung

  7. Assigning Suffix Address • Each computer must have a unique suffix address in the same network; while two computers in two different networks can have identical suffix address. • Assign any unique suffix to each computer / router within a network without considering the addresses in the other networks. • If the suffix is 00…0 or 11…1, the corresponding IP addresses have special meaning. Do not assign these suffixes. • An IP address with suffix equal to 00…0 is used to refer to the network itself. • An IP address with suffix equal to 11…1 is a directed broadcast address, i.e., it refers to all hosts on the network. • Example • An organization wants to form a private TCP/IP internet with four networks, where one network is large (with many computers), two are medium, and one is small. Dr. Y.W. Leung

  8. Firstly, assign a unique prefix to each network: • Assign a class A prefix for the large network (say, 10). • Assign a class B prefix for each of the two medium networks (say, 128.10 and 128.11). • Assign a class C prefix for the small network (say, 192.5.48). • Secondly, assign a unique suffix to each computer within each network: Dr. Y.W. Leung

  9. IP Addresses for Routers • A router is connected to multiple networks. • It belongs to multiple networks. • It is assigned multiple IP addresses where every IP address corresponds to one network. • Example: • Correction of misconception: • An internet address does not really identifies a host, but only a network connection at which a host attaches to a network. • Can all the IP addresses of a router have the same suffix? Dr. Y.W. Leung

  10. Subnet addressing • also called subnet routing, or subnetting • one IP network address, but with two or more physical networks • Only local routers know that there are multiple physical networks and how to route traffic among them. • Example: Dr. Y.W. Leung

  11. Hierarchical addressing concept • Subdivide the 32-bit IP address into {network number, subnet number, and host number}. • Analogous to telephone system: • (852) 3411-XXXX {area code, exchange number, connection number} Dr. Y.W. Leung

  12. Common scenario • The number of subnets may grow in the future. (See figure above.) • The number of machines in each subnet may be uneven. Dr. Y.W. Leung

  13. Flexibility in subnet address assignment • Fixed-length subnetting • Number of bits for subnets in the IP address is the same for all physical networks in the same organization. • (Recall that all 1…1’s and 0…0’s addresses are reserved.) • Disadvantage: there is a maximum number of machines in each subnet. • Advantage: simplicity of management and routing. Dr. Y.W. Leung

  14. Flexibility in subnet address assignment (cont.) • Variable-length subnetting • Number of bits for subnets varies. Hence number of machines in each subnet may vary. • This scheme is uncommon because it causes confusion easily. Dr. Y.W. Leung

  15. Advantage of classful addressing scheme • small routing table for routers • one routing entry per network • Weaknesses in classful addressing scheme • Addresses refer to network connections • If a host computer (notebook) moves from one network to another, its IP address must change because the network id has changed. • When any class C network grows to more than 255 hosts, it must have its address changed to a class B address. • The change must be done abruptly for all machines. • difficult to debug individual machines • insufficient number of network addresses • Remedies • Interim solution: assign a few Class C blocks instead of a Class B network address to fulfill a network address application. (Classless Addressing) • Internet Protocol Version 6 (IPV6): 128-bit IP addresses Dr. Y.W. Leung

  16. The Internet Layer • The most fundamental internet service consists of a packet delivery system. • unreliable • The packet may be lost, duplicated, delayed, or delivered out of order, but the service will not detect such conditions, nor will it inform the sender or receiver. • best-effort • The internet tries its best to deliver the packet, but delivery is not guaranteed. • connectionless • The path used by each packet may be different. • Purpose of the Internet Protocol (IP) • The IP protocol defines the basic unit of data transfer used throughout a TCP/IP internet. • exact format of all data specified • IP software performs the routing function. • IP includes a set of rules that embody the idea of unreliable packet delivery. • How hosts and routers should process packets. • How and when error messages should be generated. • The conditions under which packets can be discarded. Dr. Y.W. Leung

  17. IP Datagrams • An internet connects many different networks having different packet formats. • IP datagram is defined as a network-independent packet format: • The header contains the IP addresses of the source and the destination. • The data area can contain a variable amount of data. Dr. Y.W. Leung

  18. The details of an IP datagram: • Header • The header is composed of two parts: • 20-byte fixed part • an optional part that has a variable length and can have up to 40 bytes • Maximum header size is 60 bytes. • Data • The data can have a variable size, subject to the constraint that the maximum IP datagram size is 216 - 1 = 65535 bytes. Dr. Y.W. Leung

  19. VERS: IP protocol version number • HLEN: Header length measured in 32-bit words • minimum value = 5 • TOTAL LENGTH (16-bit field): total length of datagram in octets, including header and data • Max possible size of datagram = 216 – 1 = 65535 octets • SERVICE TYPE: hints to intermediate routers about special treatment of datagram, such as priority/precedence, low delay, etc. • IDENTIFICATION, FLAGS, AND FRAGMENT OFFSET: fields used by intermediate routers to break down a large datagram into smaller fragments • The smaller fragments will only be reassembled at the final destination. • TYPE: which high-level protocol was used to create the data. • IP OPTIONS: mainly for network testing or debugging. Dr. Y.W. Leung

  20. (MTU = Maximum Transfer Unit) Dr. Y.W. Leung

  21. Delivery of IP Datagrams • A datagram may go through several intermediate networks before reaching the destination. • Problem • Each intermediate network uses its own address and frame format, and it does not understand IP address and datagram format. • Solution: Encapsulation • The frame header contains the field frame type, which indicates that it carries an IP datagram. • The frame header contains the hardwareaddress of the next hop, where the hardware address can be obtained by address resolution. Dr. Y.W. Leung

  22. Example • A datagram is encapsulated and unencapsulated as it travels from a source to a destination through three networks and two routers: Dr. Y.W. Leung

  23. Network byte order • used for representing integers (4 bytes) on the internet • All intermediate routers must be able to read, say, the TOTAL LENGTH field, in an IP datagram correctly. • Little Endian • Lowest memory address contains the low-order byte of the integer. • Intel 80x86, Pentium, Dec VAX, Dec PDP-11 • Big Endian • opposite of Little Endian • IBM 370, Motorola 68000 series, Pyramid • The network standard byte order uses Big Endian. Dr. Y.W. Leung

  24. Tutorial Problems • Each IP address consists of a prefix and a suffix. State the advantages and disadvantages of this addressing scheme. • Are the following valid IP addresses: • • • • An organization has two networks: network A has 100 computers and network B has 500 computers. These networks will be connected to a router, and this router will be connected to the Internet. The organization is going to get two prefix addresses. Select suitable prefix addresses and assign IP addresses to the computers and routers. • Computer A sends several IP datagrams to computer B through the Internet. Explain briefly why computer B • may not receive some of the IP datagrams; • may receive the IP datagrams in a wrong order. • A student argued that IP is useless because IP is unreliable but we need reliable information retrieval/delivery through the Internet. Do you agree? Dr. Y.W. Leung