EEC-484/584 EEC-484/584 Computer Networks Computer Networks Lecture 13 Lecture 13 Wenbing Zhao Wenbing Zhao [email protected][email protected](Part of the slides are based on Drs. Kurose & (Part of the slides are based on Drs. Kurose & Ross’s slides for their Ross’s slides for their Computer Networking Computer Networking book, book, and and on materials supplied by on materials supplied by Dr. Louise Moser at UCSB and Prentice-Hall) Dr. Louise Moser at UCSB and Prentice-Hall)
32
Embed
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao [email protected] (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
[email protected]@ieee.org(Part of the slides are based on Drs. Kurose & Ross’s slides (Part of the slides are based on Drs. Kurose & Ross’s slides
for their for their Computer Networking Computer Networking book, and book, and on materials supplied by on materials supplied by Dr. Louise Moser at UCSB and Prentice-Hall)Dr. Louise Moser at UCSB and Prentice-Hall)
• Classful addressing - every host and router has unique IP address consisting of network number and host number (2 level hierarchy)– E.g., Class A: up to 27 = 128 networks with up to 224
= 16,777,216 hosts each
• Network numbers are managed by ICANN (Internet Corporation for Assigned Names and numbers) to avoid conflicts
• No longer used, but references to it are still common
SubnetsSubnets• Allow a network to be split into several parts for internal use,
but to act as a single network to outside world• Take some bits away from host numbers• Subnet mask – needed by the main router. Indicates split
between network + subnet number and host– Write the address and the mask as a binary number– If mask bit is 1, then corresponding bit of address matters
• Each router has a table listing two types of entries:– (network, 0): tells how to get to distant networks– (this-network, host): tells how to get to a local host
• When an IP packet arrives, its destination address is looked up in the routing table– If the packet is for a distant network, it is forwarded to the
next router on the interface given in the table– If it is for a local host, it is sent directly to the destination– If the network is not present, the packet is forwarded to a
Routing with SubnetsRouting with Subnets• For example, a packet address to 130.50.15.6, the
subnet mask is 255.255.252.0/22, AND them, we get 130.50.12.0 and this address is looked up in the routing table to find out which output line to use
10000010 00110010 00000100 00000000 Output to line A10000010 00110010 00001000 00000000 Output to line B10000010 00110010 00001100 00000000 Output to line C
10000010 00110010 00001111 00000110 (Destination IP Addr: 130.50.15.6)
Classless Allocation – ExampleClassless Allocation – Example
5-59
• Routing tables are updated with the three assigned entries. Each entry contains a base address and a subnet mask (in short: base address/subnet mask)
Classless InterDomain RoutingClassless InterDomain Routing• Each routing table is extended by giving it a 32-bit mask• The routing table contains entries of
(IP address, subnet mask, outgoing line) triples• When a packet comes in, its destination IP address is first
extracted• Then, the routing table is scanned entry by entry, masking
the destination address and comparing it to the table entry looking for a match
• If multiple entries (with different subnet mask lengths) match, the longest mask is used– E.g., if there is a match for a /20 mask and a /24 mask, the /24
• Aggregate entry – all three new entries can be combined into a single aggregate entry 194.24.0.0/19 with a binary address and submask as follows:11000010 00000000 00000000 00000000 11111111 11111111 11100000 00000000
• By aggregating the three entries, a router has reduced its table size by two entries
• Aggregation is heavily used throughout the Internet
• Another workaround for the IP addresses shortage problem: network address translation– One public IP address, many private IP addresses– When a packet exits the private network and goes to the ISP, an
address translation takes place
• Three ranges of IP addresses have been declared as private:– 10.0.0.0 – 10.255.255.255 (16,777,216 hosts)– 172.16.0.0 – 172.31.255.255/12 (1,048,576 hosts)– 192.168.0.0 – 192.168.255.255/16 (65,536 hosts)
• NAT violates the architectural model of IP, which states that every IP address uniquely identifies a single machine worldwide
• NAT box must maintain mapping info for each connection passing through it. This changes the Internet from a connectionless network to a kind of connection-oriented network
• NAT violates the most fundamental rule of protocol layering: layer k may not make any assumptions about what layer k+1 has put into the payload field
• NAT only support UDP/TCP traffic• NAT has problem supporting apps that include local IPs in payload,
such as FTP and H.323• Each NAT box can support at most 65,536 (216) hosts
Internet Control Message ProtocolInternet Control Message Protocol• ICMP messages are sent using the basic IP header • The first byte of the data portion of the datagram is a
ICMP type field– The type field determines the format of the remaining data
• Typical format: type, code plus first 8 bytes of IP datagram causing error
The Main IPv6 HeaderThe Main IPv6 Header• Version 6• Priority
– 0-7 slow down in event of congestion– 8-15 real-time traffic
• Flow label – allows source and destination to set up pseudo-connection with particular properties and requirements
• Payload length (as opposed to total length in IPv4)• Next header – additional optional extension header• Hop limit (time to live in IPv4)• Source/destination address – 128 bits (32 bits in IPv4)
IPv6 Extension HeadersIPv6 Extension Headers• Hop-by-hop options: used for info that all routers
along the path must examine– One option has been defined to support datagrams
exceeding 64K• Next header: 1-byte field telling type of header• Length field: 1-byte field telling how long the hop-by-hop header
is in bytes, excluding the first 8 bytes, which are mandatory• 1-byte field indicating that this option defines the datagram size• 1-byte field telling the size is a 4-byte number• 4-byte field: size of datagram
IPv6 Extension HeadersIPv6 Extension Headers• Routing option header: lists one or more routers that
must be visited on the way to destination– Routing type field: 1-byte giving format of the rest of the header– Segments left field: 1-byte keeping track of how many of the
Exercise - CIDRExercise - CIDR• According to Classless InterDomain Routing, the
remaining IP addresses are allocated in variable-sized blocks, without regard to the classes. However, the starting address must fall on the boundary of the block size allocated. Assuming that a large number of consecutive IP address are available starting at 194.24.0.0. Suppose that three organizations, A, B, and C, request 4000, 1000, and 2000 addresses, respectively, and in that order. For each of these, give the first IP address assigned, the last IP address assigned, both must be in dotted decimal form, and the mask in the w.x.y.z/s notation.
• A router has just received the following new IP addresses: 57.6.96.0/21, 57.6.104.0/21, 57.6.112.0/21, and 57.6.120.0/21. If all of them use the same outgoing line, can they be aggregated? If so, to what? If not, why not?