More on the IP Internet Protocol. Internet Layer Process Transport layer process passes EACH TCP...
-
Upload
alexis-houston -
Category
Documents
-
view
230 -
download
1
Transcript of More on the IP Internet Protocol. Internet Layer Process Transport layer process passes EACH TCP...
More on the IP
Internet Protocol
Internet Layer Process• Transport layer process passes EACH TCP
segment to the internet layer process for delivery
Transport LayerProcess
Internet LayerProcess
TCP segment
IP: Connectionless Service
• The Internet Protocol (IP)– Internet layer protocol– IP messages are called IP packets
• No connections are established– No open, close, error correction, flow control– Low overhead
InternetProcess
InternetProcess
IP Packet
IP: Connectionless Service
• IP is unreliable– No error handling (Let TCP catch errors!)– No sequence numbers, so no way to put
arriving IP packets in order (Let TCP put the TCP segments these IP packets contain in order!)
InternetProcess
InternetProcess
IP Packet
TCP/IP Partnership• TCP checks for errors once, at the
destination host
• IP is used in many hops between routers– Not checking for errors at each step greatly
reduces overall processing work– Reduces router costsTransport Transport
Internet Internet Internet
Check Only Once
Host Router Host
Cobnnectionless IP• IP is unreliable (does not catch errors)
– But this is not bad
– First, errors are caught--at the next-higher layer (transport) if TCP is used
– Second, avoiding error checking at each hop between routers lowers router costs
– Far less expensive to check for errors on one destination host than on many routers along the way
IP is a Best-Effort Service• IP Only Offers Best-Effort Service
– Does its best to get packets through
– No guarantees of delivery
– No way to give priority to time-sensitive traffic, such as voice
• Overall, low overhead but limited Quality of Service (QoS)
• QoS should change in the future (see Chapter 8)
IP Address• 32-bit Strings
– Often given in dotted decimal notation: 128.171.17.13
• Fits into 32-bit source and destination address field of IP headers
IP Packet
32-bit Source and Destination Addresses
IP Addresses and Router Forwarding• Routers use the destination IP address of
an incoming packet in the router forwarding decision, that is, to decide what output port to use to send the packet back out to the destination host or to another router
B?
D?
C?
Router A
B
C
DPacket
IP Addresses• Many Addressing Systems Use
Hierarchical Addressing– Postal delivery: city, street address– Post office looks at city first
• If not P.O.’s city, put in bag for other city• If in P.O.’s city, put in bag for sorting by street
address
– Hierarchical addressing greatly speeds sorting at each post office
• Imagine if we needed a sorting bin for each address in the country!
IP Addresses• For IP, Routers Take the Place of Post Offices
– There are hundreds of millions of IP addresses on the Internet
– Routers cannot store decision rules for reaching each address individually
– So router simply asks if a destination IP address is that of a host on one one of the networks or subnets connected to the router or must be passed on to another router
– This is the router forwarding decision
IP Addresses• To Simplify Router Decisions, IP
Addresses are Hierarchical• The Internet is Made of Many Individual
Networks Owned by Different Organizations
• First route packets to a single network; only need one “sorting bin” for each network!
• In the next step, route packet to host on the network
IP Addresses• Each Organization is Given a Network
Part Number
• For the University of Hawaii, this is 128.171– All IP Addresses in that Organization’s
Network Begin with that Network Part
Network Part
IP Address
128.171
IP Addresses• Network Parts can be 8 to 24 bits long
– For University of Hawaii, it is 16 bits long
– 16 bits is only an example
Network Part(8 to 24 bits)
IP Address
IP Addresses• Between different organization networks,
routers look first at the Network Part of an arriving IP packet’s destination address
– If the network part is not that of the organization, the router cannot deliver the IP packet locally
– Passes the IP packet on to another router, called a next-hop router, to move the IP packet closer to the destination host
Network Part
IP Addresses
• Local Part– The part of the IP address after the network part
is called the local part– Total address is 32 bits, so if the network part is
8, the local part is 24
Network Part Local Part
IP Address (32 bits total)
Assigning Network Parts• Organization applies to an Internet IP address
registrar– Registrar gives organization a network part
– Organization assigns the local part to its hosts internally
– Only large organizations and ISPs get network parts
Registrar Firm128.171
128.171.17.13
128.171.123.130
Assigning Parts• Example
– IP address registrar gave the University of Hawaii the network part 128.171
– UH gave the College of Business Administration the subnet part 17
– College of Business Administration gave the host part 13 to a computer it later gave the host name voyager.cba.hawaii.edu
– So the computer’s IP address became 128.171.17.13.
IP Addresses
• Most Organizations Have Multiple Subnets within the Organizational Network– Usually represent each as a Subnet Part within
the Local Part– Remaining Bits are the Host Part, designating a
particular host on that subnet
Network Part Subnet Part
IP Address (32 bits total)
Host Part
Local Part
Assigning Subnet Parts• Organization Assigns Subnet Parts
– Assigns subnet parts to suborganizations
– Suborganization assigns host bits to hosts
Registrar Firm
128.171 128.171.17.13
128.171.17.13
Suborganization
Host
IP Addresses• Within an organizational Network
– Router looks at Network Plus Subnet Part Combined
– If destination host is on a subnet attached to the router, delivers the IP packet to the host
– Otherwise, passes the packet on to a next-hop router
Network Part Subnet Part
IP Address (32 bits total)
Host Part
Local Part
IP Addresses• In IP Addresses, “Network” and “Subnet” are
Organizational Concepts, not Technical Concepts
• Network is the collection of individual networks and routers owned by an organization
• Subnet is a collection of individual networks and routers owned by a suborganization– Often a single physical network (subnet)
Importance of Part Sizes• Determine Number of Possible Networks,
Subnets, or Hosts• If There are N Bits in the Part, there can be 2N
possible Networks, Subnets, or Hosts• Actually, 2N-2
– All zeros cannot be used for a part
– All ones cannot be used for a part
• Example: if part has 8 bits, 28-2 possibilities (254)
Masks• IP Addresses are Always Paired with a Second
32-bit Number Called a Mask• Two Types: Network Masks and Subnet Masks
– Network Mask Tells the Length of the Network Part
– Subnet Mask Tells the length of the Network Plus Subnet Parts (not just subnet part)
– IP Address will be paired with one or the other, but not both simultaneously
Masks• Masks Begin with 1s, End with 0s (111…
00)
• For network masks, 1s are in Network Part bits; 0s are in Subnet and Host Parts
• For subnet masks, 1s are in Network and Subnet Parts; 0s are in Host part
11111111111111110000000000000000
Masks• IP Address-Mask Pairs often Written with
Prefix Notation– 128.171.17.13/16– 16 means that the mask has 16 initial 1s– Total number of bits is 32 in an IP address, so
there must be 16 trailing 0s
11111111111111110000000000000000
Router Delivery• If Destination Host is On the Source
Host’s Subnet, Source Host Delivers the Packet Directly– No router is involved
Subnet
Subnet
SourceHost
Destination Host
Router Delivery• If Destination Host is NOT On the
Source Host’s Subnet, Source Host Sends the Packet to a Router for Delivery
Subnet
Subnet
Router Delivery• If Destination Host is On One of the
Router’s Subnets, the Router Sends the Packet to the Destination Host for Delivery
Subnet
Subnet
Router Delivery• If Destination Host is NOT On One of
the Router’s Subnets, the Router Sends the Packet to a Next-Hop Router for Delivery– May have to choose among several possible
next-hop routers for deliverySubnet
Subnet
Router Delivery• Border Routers Connect Networks, Not
Subnets– Select between next-hop router on own
network or on another network
Own Network
Other Network
Router Forwarding Tables
• Allow Routers to Decide Whether Local Delivery is Possible to Destination Host
• Allow Routers to Select Next-Hop Router if Local Delivery is Not Possible
Router Forwarding Tables• Router Compares Destination IP Address to
Each Row in Router Forwarding Table– If matches IP address, delivers according to
Delivery rule– So if destination address of IP packet is
128.171.17.13, router delivers packet locally
IP Address Delivery
128.171.17.13 Local
142.99.171.3 Next-Hop Router A
Router Forwarding Tables• Also Has a Mask Column
– Masks destination IP Address of packet– If Mask in a row is 24 bits long, router only
compares first 24 bits of packet’s IP dest. addr.– Compares to IP Address Part for that row
IP Address Part
Mask Destination
127.171.17 24 Local
142 8 Next-Hop Router A
Router Forwarding Tables• Also Has a Mask Column
– A network mask for a host outside the organization’s network
– A subnet mask for an internal host– Can’t tell which by looking at the mask
IP Address Part
Mask Destination
127.171.17 24 Local
142 8 Next-Hop Router A
Router Forwarding Tables• Also Has a Mask Column
– Masks destination IP Address of packet
– IP Address Part really is a network part or network plus subnet part of a network or subnet, respectively
IP Address Part
Mask Destination
127.171.17 24 Local
142 8 Next-Hop Router A
Not in the Book
Router Forwarding Tables• Matching Destination IP Addresses
– Example: Destination IP Address is 127.171.17.13
– Mask is 24, so only look at 127.171.17– Matches row’s IP address part, so use Local
delivery
IP Address Part
Mask Destination
127.171.17 24 Local
142 8 Next-Hop Router A
Router Forwarding Tables• Longest Match Principle
– Must select one row to determine delivery
– If two rows match, use longest match, that is match to greatest number of bits
– For 127.171.17.13, use local delivery (24-bit match)
IP Address Part
Mask Destination
127.171.17 24 Local
128.171 16 Next-Hop Router A
Router Forwarding Tables• Metric
– If same length of match, turn to metric column– Metric describes the desirability of a choice– If metric is cost, choose lowest cost– For other metrics (speed, etc.), may chose largest
value
IP Address Part
Mask Metric (Cost)
Delivery
128.171 16 23 Local
128.171 16 45 Next-Hop Router A
Router Forwarding Tables
• There May be No Matches– One IP Address Part is Always 0.0.0.0– If there is no match, choose its next-hop
router (called the Default Router)
IP Address Delivery
128.171.17.13 Local
0.0.0.0 Next-Hop Router C
Router Forwarding Tables• Recap of Selection Rules
– Compare destination IP address of an arriving packet against ALL rows within the router forwarding table because there may be multiple matches
– Select the single row that matches
– If multiple rows match, select the longest match
– If multiple rows tie on the longest match, select the row with the largest or smallest metric, depending on the specific metric
– If there is no match, select the default router row
Router Forwarding Tables• Delivery
– Table not only designates local delivery or a next hop router
– Also designates the router interface (port) that will be used for delivery
Interface Delivery
2 Local
3 Next-Hop Router C
3 Next-Hop Router D
Dynamic Routing Protocols
• How Do Routers Get Information for their Router Forwarding Tables?– Share router forwarding table information– Standards for these exchanges are called
dynamic routing protocols
Router ForwardingTable Information
Dynamic Routing Protocols• How Do Routers Get Information for their
Router Forwarding Tables?– Thanks to dynamic routing protocols, the Internet
needs no central point of control
– Routers create their router forwarding tables strictly by information from peers and their own knowledge
Router ForwardingTable Information
IP Version 6
• Current Version of IP is IP Version 4– This is the version we have been discussing– Has 32-bit IP address fields– Not long enough; running out of IP addresses
• Next Version will be IP Version 6– Will have 128-bit IP address fields– Will allow vast numbers of IP addresses (2128)– Being adopted slowly
Terminology Confusion
• TCP/IP is a Standards Architecture
– Includes not only TCP and IP but also UDP, HTTP, and many other protocols
– May not even use TCP (UDP instead) or IP (ARP instead, as discussed in Module A)
• TCP and IP are Individual Standards– Within the TCP/IP Architecture