92
Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Embed Size (px)

Citation preview

Page 1: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Internetworking

Outline Internetworking by IPRoutingGlobal InternetMulticast

Page 2: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Problem: There is more than one network

• Two problems that must be addressed:– Heterogeneity– Scale

• The scaling problem:– Routing – How to find an efficient path?– Addressing – The task of providing suitable identifiers

for all those nodes.

Page 3: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Internetworking

Outline Best Effort Service ModelGlobal Addressing Scheme

Page 4: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

What is an Internetwork?

• An internetwork is an arbitrary collection of networks interconnected to provide some sort of host-to-host packet delivery service.

• A network is either a directly connected or a switched network that uses one technology. An internetwork is an interconnected collection of such networks.

• An internetwork is a logical network built out a collection of physical networks.

• An internetwork is often referred to as a “network of networks” as shown in Figure 4.1

Page 5: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IP Internet

• Concatenation of Networks

(Figure 4.1)

• Protocol Stack

(Figure 4.2)

R2

R1

H4

H5

H3H2H1

Network 2 (Ethernet)

Network 1 (Ethernet)

H6

Network 3 (FDDI)

Network 4(point-to-point)

H7 R3 H8

R1

ETH FDDI

IPIP

ETH

TCP R2

FDDI PPP

IP

R3

PPP ETH

IP

H1

IP

ETH

TCP

H8

Page 6: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

What is an Internetwork?

• The Internet Protocol was originally known as the Kahn-Cerf protocol. IP allows a collection of networks to function as a single logical internetwork as shown in Figure 4.2.

• It is possible to build an internetwork that does not use IP. For example, Novell uses IPX (Internetwork Packet Exchange) protocol, Appletalk uses DDP (Datagram Delivery Protocol).

Page 7: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Service Model• Connectionless (datagram-based)• Best-effort delivery (unreliable service)

– packets are lost– packets are delivered out of order– duplicate copies of a packet are delivered– packets can be delayed for a long time

• Datagram formatVersion HLen TOS Length

Ident Flags Offset

TTL Protocol Checksum

SourceAddr

DestinationAddr

Options (variable) Pad(variable)

0 4 8 16 19 31

Data

Page 8: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IPv4 Header• IPv4 header format

– Version: the version of IP– HLen: the length of the header in 32-bit words. The header is 5

words (20 bytes) long when there are no options.– TOS: type of service– Length: length of the datagram in bytes. The maximum size of an

IP datagram is 65,535 bytes.– Identification: All the fragments of a datagram contain the same

identification value.– Flags: DF (don’t fragment), MF (more fragments)– Fragment offset: offset from the beginning of the datagram– TTL: time to live. The default value is 64.– Protocol: identifies the higher-level protocol to which this IP

packet should be passed. The defined values for TCP is 6 and UDP is 17.

– Checksum: The checksum is calculated.– SourceAddr: the source address– DestinationAddr: the destination address– Option: more specific control

Page 9: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IPv4 Header

Some of the IP options.

5-54

Page 10: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Fragmentation and Reassembly

• Each network has some maximum transmission unit (MTU)

• Strategy– fragment when necessary (MTU < Datagram)– try to avoid fragmentation at source host– re-fragmentation is possible – fragments are self-contained datagrams– use CS-PDU (Convergence Sublayer – Protocol Data Unit) (not

cells) for ATM– delay reassembly until destination host– do not recover from lost fragments

Page 11: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Example

H1 R1 R2 R3 H8

ETH IP (1400) FDDI IP (1400) PPP IP (512)

PPP IP (376)

PPP IP (512)

ETH IP (512)

ETH IP (376)

ETH IP (512)

Ident = x Offset = 0

Start of header

0

Rest of header

1400 data bytes

Ident = x Offset = 0

Start of header

1

Rest of header

512 data bytes

Ident = x Offset = 512

Start of header

1

Rest of header

512 data bytes

Ident = x Offset = 1024

Start of header

0

Rest of header

376 data bytes

• The router R2 has an MTU of 532 bytes excluding the PPP header, which leaves 512 bytes for data after the 20-byte IP header.

Page 12: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Global Addresses

• Properties– globally unique– hierarchical: network + host

• Dot Notation– 10.3.2.4– 128.96.33.81– 192.12.69.77

Network Host

7 24

0A:

Network Host

14 16

1 0B:

Network Host

21 8

1 1 0C:

Page 13: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IP Addresses

IP address formats.

Page 14: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IP Addresses

Special IP addresses.

Page 15: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Datagram Forwarding • Strategy

– every datagram contains destination’s address– if directly connected to destination network, then forward to host– if not directly connected to destination network, then forward to

some router– forwarding table maps network number into next hop– each host has a default router– each router maintains a forwarding table

• Example (R2) Network Number Next Hop 1 R3 2 R1 3 interface 1 4 interface 0

Page 16: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Datagram Forwarding

$ netstat -rn

Kernel IP routing table

Destination Gateway Genmask Flags MSS Window irtt Iface

156.26.10.128 0.0.0.0 255.255.255.128 U 40 0 0 eth0

192.168.1.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1

0.0.0.0 156.26.10.129 0.0.0.0 UG 40 0 0 eth0

$ ping kirk

PING kirk.cs.twsu.edu (156.26.10.239): 56 data bytes

Page 17: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Hubs, Repeaters, Bridges

• Repeaters are nodes in the physical layer.– A repeater is a product that receives, amplifies, and retransmits

signals in both directions.

• In data communications, a hub is a place of convergence where data arrives from one or more directions and is forwarded out in one or more other directions.

• Bridges are nodes in the data link layer.– A bridge is a product that connects a local area network (LAN) to

another local area network that uses the same protocol.

– Forward frames.

Page 18: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Switches, Routers

• Switches are nodes in the data link or the network layer.– A switch is a network device that selects a path or circuit for

sending a unit of data (packet) to its next destination.

– Forward packets.

• Routers are nodes in the network layer (internetwork-level).– A router connects a network to one or more other networks that

are usually part of a wide area network (WAN).

– Forward datagrams.

• A brouter is a network bridge and a router combined in a single product.

Page 19: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Gateways

• Gateways are nodes in the transport layer. – A gateway is a network point that acts as an entrance to

another network.

– A gateway is often associated with both a router, which knows where to direct a given packet of data that arrives at the gateway, and a switch, which furnishes the actual path in and out of the gateway for a given packet.

– A computer server acting as a gateway node is often also acting as a proxy server and a firewall server.

Page 20: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Repeaters, Hubs, Bridges, Switches, Routers and Gateways

(a) Which device is in which layer.

(b) Frames, packets, and headers.

Page 21: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Repeaters, Hubs, Bridges, Switches, Routers and Gateways

(a) A hub. (b) A bridge. (c) a switch.

Page 22: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Proxy Server and Firewall

• In an enterprise that uses the Internet, a proxy server is a server that acts as an intermediary between a workstation user and the Internet so that the enterprise can ensure security, administrative control, and caching service. Routers are internet-level nodes.

• A firewall is a set of related programs, usually located at a network gateway server, that protects the resources of a private network from users from other networks.

Page 23: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Address Translation • Map IP addresses into physical addresses and send the

frame to:– the destination host– the next hop router that promises to forward it to the destination

• Techniques– encode physical address in host part of IP address

• For example, 128.96.33.81. 33.81 is the physical address.• A limited solution

– table-based: (IP address physical address)• ARP (Address Resolution Protocol)

– Check for the table of IP to physical address bindings in the cache– Broadcast request if IP address not in the table– Target machine responds with its physical address– Hosts receiving the request update the ARP table if the sender in

in that table. Table entries are discarded if not refreshed to reset the expiration time.

Page 24: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

ARP Details

• Request Format– HardwareType: type of physical network (e.g., Ethernet)– ProtocolType: type of higher layer protocol (e.g., IP)– HLEN & PLEN: length of physical and protocol addresses– Operation: request or response – Source/Target-Physical/Protocol addresses

• Notes– table entries timeout in about 10 minutes– update table with source when you are the target – update table if already have an entry– do not refresh table entries upon reference

Page 25: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

ARP Packet Format

TargetHardwareAddr (bytes 2 – 5)

TargetProtocolAddr (bytes 0 – 3)

SourceProtocolAddr (bytes 2 – 3)

Hardware type = 1 ProtocolType = 0x0800

SourceHardwareAddr (bytes 4 – 5)

TargetHardwareAddr (bytes 0 – 1)

SourceProtocolAddr (bytes 0 – 1)

HLen = 48 PLen = 32 Operation

SourceHardwareAddr (bytes 0 – 3)

0 8 16 31

Page 26: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

ATMARP

• It is a part of the Classical IP over ATM model.

• One large ATM network is subdivided into several logical IP subnets (LIS). Each LIS has the same IP network address.

• An ARP server is to enable nodes on a LIS to resolve IP address to ATM address without using broadcast.

• LIS is configured with the ATM address of the ARP server, so that it can establish a VC to the server when booting.

• Two nodes on different subnets have to set up a VC through the ARP server (router).

Page 27: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Host Configuration (DHCP)

• Dynamic Host Configuration Protocol (DHCP) is a communications protocol that lets network administrators manage centrally and automate the assignment of Internet Protocol (IP) addresses in an organization's network.

• Operation of DHCP

– To contact a DHCP server, a newly booted or attached host broadcasts a DHCPDISCOVER message.

– When a DHCP relay agent receive the message, it unicasts it to the DHCP server and relay the response from the remote DHCP to the booting machine.

Page 28: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Host Configuration (DHCP)

• DHCP is an alternative to another network IP management protocol, Bootstrap Protocol (BOOTP). DHCP is a more advanced protocol

• BOOTP (Bootstrap Protocol) is a protocol that lets a network user be automatically configured (receive an IP address) and have an operating system booted (initiated) without user involvement.

Page 29: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Internet Control Message Protocol (ICMP)

• The Internet Control Message Protocol (ICMP) defines a collection of error messages that are sent back to the source host whenever a router or host is unable to process an IP datagram successfully.

• ICMP defines messages such as– Echo: ping - send ICMP ECHO_REQUEST packets to network

hosts– Redirect (from router to source host)– Destination unreachable (protocol, port, or host)– TTL exceeded (so datagrams don’t cycle forever)– Checksum failed – Reassembly failed– Cannot fragment

Page 30: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Virtual Private Network

• A VPN (virtual private network) is a way to use a public telecommunication infrastructure, such as the Internet, to provide remote offices or individual users with secure access to their organization's network.

• A VPN works by using the shared public infrastructure while maintaining privacy through security procedures and tunneling protocols.

Page 31: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Tunnels

• Tunneling is the transmission of data intended for use only within a private, usually corporate network through a public network in such a way that the routing nodes in the public network are unaware that the transmission is part of a private network. A VPN works by using the shared public infrastructure while maintaining privacy through security procedures and tunneling protocols.

• Tunneling is generally done by encapsulating the private network data and protocol information within the public network transmission units so that the private network protocol information appears to the public network as data.

Page 32: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Routing

OutlineAlgorithms

Scalability

Page 33: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Overview• Forwarding vs. Routing

– forwarding: to select an output port based on destination address and routing table

– routing: process by which routing table is built• Network as a Graph

• Problem: Find lowest cost path between two nodes• Factors

– static: topology (shortcomings)– dynamic: load

4

3

6

21

9

1

1D

A

FE

B

C

Page 34: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Distance Vector• Each node maintains a set of triples

– (Destination, Cost, NextHop)

• Construct the distance vector– Initially, each node sets a cost of 1 to its directly connected

neighbors and infinity to all other nodes.– Every node sends a message to its directly connected neighbors

containing its personal list of distances.

• Exchange updates directly connected neighbors– periodically (on the order of several seconds)– whenever its table changes (called triggered update)

• Each update is a list of pairs:– (Destination, Cost)

Page 35: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Distance Vector• Update local table if receive a “better” route

– smaller cost– came from next-hop

• Refresh existing routes; delete if they time out• When a node or a node fails:

– A node continually tests the link to another node by sending a control packet

– A node determines that the link or the node is down if it doesn’t receive the expected periodic routing update

• Updating the routing table when a node or a link fails could cause the count to infinity problem.

Page 36: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Example

Destination Cost Next Hop A 1 A C 1 C D 2 C E 2 A F 2 A G 3 A

D

G

A

F

E

B

C

Page 37: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Failure Detection and Routing Loop• Example 1

– F detects that link to G has failed– F sets distance to G to infinity and sends update t o A– A sets distance to G to infinity since it uses F to reach G– A receives periodic update from C with 2-hop path to G– A sets distance to G to 3 and sends update to F– F decides it can reach G in 4 hops via A

• Example 2– link from A to E fails– A advertises distance of infinity to E– B and C advertise a distance of 2 to E– B decides it can reach E in 3 hops; advertises this to A– A decides it can read E in 4 hops; advertises this to C– C decides that it can reach E in 5 hops…

Page 38: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Loop-Breaking Heuristics

• Set infinity to 16

• Split horizon– When a node sends a routing update to its neighbors, it does not

send those routes it learned from each neighbor back to that neighbor

– For example, if B has the route (E, 2, A) in its table, it knows if must have learned this route from A, and so whenever B sends a routing to A, it doesn’t include the route (E, 2).

• Split horizon with poison reverse– For example, B sends the route (E, infinity) to A.

Page 39: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Routing Information Protocol (RIP)

• RIP (Routing Information Protocol) is a widely-used protocol for managing router information in IP networks.– RIP is considered an effective solution for small homogeneous

networks. For larger, more complicated networks, RIP's transmission of the entire routing table every 30 seconds may put a heavy amount of extra traffic in the network.

• The major alternative to RIP is the Open Shortest Path First Protocol (OSPF) .

Page 40: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Link State (OSPF)

• OSPF (Open Shortest Path First) is a router protocol used within larger networks in preference to the Routing Information Protocol (RIP).

• Assume every node knows how to reach its directly connected neighbors. Then the complete map of the network can be built.

• Link-state routing protocols rely on two mechanisms:– reliable dissemination of link-state information– the calculation of routers from the sum of all the

accumulated link-state knowledge

Page 41: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Link State• Strategy

– send to all nodes (not just neighbors) information about directly connected links (not entire routing table)

• Link State Packet (LSP)– ID of the node that created the LSP– cost of the link to each directly connected

neighbor– sequence number (SEQNO)– time-to-live (TTL) for this packet

Page 42: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Link State

• The ID and cost are for the calculation and the sequence number and TTL ensures the reliable transmission.

• Reliable flooding– store most recent LSP from each node– forward LSP to all nodes but one that sent it– generate new LSP periodically

• increment SEQNO– start SEQNO at 0 when reboot– decrement TTL of each stored LSP

• discard when TTL=0

Page 43: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Route Calculation• Dijkstra’s shortest path algorithm• Let

– N denotes set of nodes in the graph– l (i, j) denotes non-negative cost (weight) for edge (i, j)– s denotes this node– M denotes the set of nodes incorporated so far– C(n) denotes cost of the path from s to node n

M = {s}for each n in N - {s}

C(n) = l(s, n)while (N != M)

M = M union {w} such that C(w)is the minimum for all w in (N - M)for each n in (N - M)

C(n) = MIN(C(n), C (w) + l(w, n ))

Page 44: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Metrics • Original ARPANET metric

– measures number of packets enqueued on each link– took neither latency or bandwidth into consideration

• New ARPANET metric– stamp each incoming packet with its arrival time (AT)– record departure time (DT)– when link-level ACK arrives, compute

Delay = (DT - AT) + Transmit + Latency

– if timeout, reset DT to departure time for retransmission – link cost = average delay over some time period– The problem:

• Under heavy load, many links would be idle.• The range of link values was much too large.

Page 45: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Metrics

• Revised ARPANET routing metric– compressed dynamic range to account for the link type

• Fine Tuning– The delay measurement was transformed to a link utilization.– There was a hard limit on how much the metric could change.

• Observation of the Link utilization– A highly loaded link never shows a cost of more than three times

its cost when idle.

– The most expensive link is only seven times the cost of the least expensive.

– A high-speed satellite link is more attractive than a low-speed terrestrial link

– Cost is a function of link utilization only a t moderate to high loads.

Page 46: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Mobile IP

• Dynamic Host Configuration Protocol (DHCP) enables a newly connected computer to acquire a temporary IP.

• If a mobile computer is to remain accessible to client and resource-sharing applications (such as a share-monitoring service) when moving between networks, it must retain a single IP number, but IP routing is subnet-based.

• Mobile IP is a solution to allow the correct routing through different subnets.

Page 47: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Mobile IP

• When a mobile host is connected outside of its home base, a home agent (HA) and a foreign agent (FA) take responsibility of rerouting.

• The HA is responsible for holding up-to-date knowledge of the mobile host’s current location.

• When a mobile host leaves its home site, it should inform the HA. During the absence it will behave as proxy for the absent host.

Page 48: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Mobile IP

• Once the mobile host arrives at a new site, it informs the FA at that site. The FA allocates a temporary IP address (care-of address) on the local subnet and notifies the HA the mobile host’s home IP address and the care-of address.

• The next figure illustrates the Mobile IP routing mechanism.

• An IP packet addressed to the mobile host’s home address is received at the home network and routed to the HA.

Page 49: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

The Mobile IP routing mechanism

Sender

Home

Mobile host MH

Foreign agent FAInternet

agent

First IP packet addressed to MH

Address of FAreturned to sender

First IP packettunnelled to FA

Subsequent IP packetstunnelled to FA

Page 50: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Mobile IP

• The HA then encapsulates the IP packet in a Mobile IP packet and sends it to the FA. The FA unpacks the packet and deliver it to the mobile host. This uses the tunnelling technique.

• The HA also send the care-of address of the mobile host to the original sender.

• If the sender is Mobile IP enabled, the subsequent communication will directly go the new address. If it is not, it will ignore the change and continue to be routed via the HA.

Page 51: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Comments on Mobile IP

• The Mobile IP solution is effective, but hardly efficient.

• A best solution would be like what is achieved by the cellular phone network. Is that possible?

• Mobile phones do not change their number as they move between cells. Instead, they simple notify the local cellular phone base station of their presence from time to time.

Page 52: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

How to Make Routing Scale

• Two related scaling issues:– Scalability of routing: minimize the number of network

numbers in routing table

– Address utilization

• Inefficient use of Hierarchical Address Space– class C with 2 hosts (2/255 = 0.78% efficient)

– class B with 256 hosts (256/65535 = 0.39% efficient)

• Still Too Many Networks– routing tables do not scale

– route propagation protocols do not scale

Page 53: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Internet StructureRecent Past

NSFNET backboneStanford

BARRNETregional

BerkeleyPARC

NCAR

UA

UNM

Westnetregional

UNL KU

ISU

MidNetregional…

Page 54: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Internet Structure

Today

Backbone service provider

Peeringpoint

Peeringpoint

Large corporation

Large corporation

Smallcorporation

“Consumer ” ISP

“Consumer” ISP

“ Consumer” ISP

Page 55: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Subnetting• Add another level to address/routing hierarchy: subnet• Subnet masks define variable partition of host part• Subnets visible only within site

Network number Host number

Class B address

Subnet mask (255.255.255.0)

Subnetted address

111111111111111111111111 00000000

Network number Host IDSubnet ID

Page 56: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Subnetting

• A host is configured with both an IP address and a subnet mask.

• The bitwise AND of the IP address and the subnet mask defines the subnet number of the host and of all other hosts on the same subnet.

• For example, 156.26.10.239 (kirk) AND 255.255.255.128 equals 156.26.10.128.

Page 57: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Subnet Example

Forwarding table at router R1Subnet Number Subnet Mask Next Hop

128.96.34.0 255.255.255.128 interface 0

128.96.34.128 255.255.255.128 interface 1

128.96.33.0 255.255.255.0 R2

Subnet mask: 255.255.255.128Subnet number: 128.96.34.0

128.96.34.15 128.96.34.1

H1R1

128.96.34.130Subnet mask: 255.255.255.128Subnet number: 128.96.34.128

128.96.34.129128.96.34.139

R2H2

128.96.33.1128.96.33.14

Subnet mask: 255.255.255.0Subnet number: 128.96.33.0

H3

Page 58: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Forwarding Algorithm

D = destination IP addressfor each entry (SubnetNum, SubnetMask, NextHop) D1 = SubnetMask & D if D1 = SubnetNum if NextHop is an interface deliver datagram directly to D else deliver datagram to NextHop

• Use a default router if nothing matches• Not necessary for all 1s in subnet mask to align with a byte

boundary and to be contiguous (255.255.1.0 is possible.)• Can put multiple subnets on one physical network• Subnets not visible from the rest of the Internet

Page 59: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Supernetting (CIDR)

• Assign block of contiguous network numbers to nearby networks

• Called CIDR: Classless Inter-Domain Routing• Represent blocks with a single pair:

– Restrict block sizes to powers of 2

– Use a bit mask (CIDR mask) to identify block size– <base address, count> <192.15.32.0, 1024>– base address/mask 192.15.32.0/255.255.252.0– base address/bits of network part 192.15.32.0/20

• All routers must understand CIDR addressing

Page 60: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Supernetting (CIDR)

• For example, the CIDR can be used to allocate a batch of contiguous class C addresses to a subnet requiring more than 255 addresses.

• The CIDR scheme can also be used to subdivide a Class B address space for allocation to multiple subnets.

• A CIDR network address looks like this: – 192.30.250.00/18

– The "192.30.250.00" is the network address itself and the "18" says that the first 18 bits are the network part of the address, leaving the last 14 bits for specific host addresses.

Page 61: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

CIDR – Classless InterDomain Routing

A set of IP address assignments.

Page 62: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Route Propagation• Know a smarter router

– hosts know local router– local routers know site routers– site routers know core router– core routers know everything

• Autonomous System (AS)– corresponds to an administrative domain– examples: University, company, backbone network– assign each AS a 16-bit number

• Two-level route propagation hierarchy– interior gateway protocol (each AS selects its own)– exterior gateway protocol (Internet-wide standard)

Page 63: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Popular Interior (Intradomain) Gateway Protocols

• RIP: Route Information Protocol– developed for XNS– distributed with Unix– distance-vector algorithm– based on hop-count

• OSPF: Open Shortest Path First– recent Internet standard– uses link-state algorithm– supports load balancing – supports authentication

Page 64: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

EGP: Exterior (Interdomain) Gateway Protocol

• Overview– designed for tree-structured Internet– concerned with reachability, not optimal routes

• Protocol messages– neighbor acquisition: one router requests that another

be its peer; peers exchange reachability information– neighbor reachability: one router periodically tests if

the another is still reachable; exchange HELLO/ACK messages; uses a k-out-of-n rule

– routing updates: peers periodically exchange their routing tables (distance-vector)

Page 65: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

BGP-4: Border Gateway Protocol• AS Types

– stub AS: has a single connection to one other AS• carries local traffic only

– multi-homed AS: has connections to more than one AS• refuses to carry transit traffic

– transit AS: has connections to more than one AS• carries both transit and local traffic

• Each AS has:– one or more border routers sitting at the boundary

between the AS and the rest of the Internet.– At least one node to be assigned as a BGP speaker that

advertises:• local networks• other reachable networks (transit AS only)• gives path information

Page 66: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

BGP Example• Speaker for AS2 advertises reachability to P and Q

– network 128.96, 192.4.153, 192.4.32, and 192.4.3, can be reached directly from AS2

• Speaker for backbone advertises– networks 128.96, 192.4.153, 192.4.32, and 192.4.3 can be reached along

the path (AS1, AS2).• Speaker can cancel previously advertised paths

Backbone network(AS 1)

Regional provider A(AS 2)

Regional provider B(AS 3)

Customer P(AS 4)

Customer Q(AS 5)

Customer R(AS 6)

Customer S(AS 7)

128.96192.4.153

192.4.32192.4.3

192.12.69

192.4.54192.4.23

Page 67: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IP Version 6• Features

– 128-bit addresses (classless) (1500/square foot of the earth’s surface)

– multicast– real-time service– authentication and security – Auto-configuration – end-to-end fragmentation– protocol extensions

• Header– 40-byte “base” header

– extension headers (fixed order, mostly fixed length)• fragmentation

• source routing

• authentication and security

• other options

Page 68: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Why IPv6? More Addresses!• IP address allocation history:

1981 - IPv4 protocol published1985 ~ 1/16 total space1990 ~ 1/8 total space1995 ~ 1/4 total space2000 ~ 1/2 total space

• this despite increasingly intense conservation efforts– CIDR (classless inter-domain routing)– PPP address sharing– NAT (network address translation)

• theoretical limit of 32-bit space: ~4 billion devices;practical limit of 32-bit space: ~250 million devices

Page 69: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

How Was IPv6 Address Size Chosen?

• some wanted fixed-length, 64-bit addresses– easily good for 1012 sites, 1015 nodes, at .0001 allocation efficiency (3

orders of mag. more than IPng requirement)– minimizes growth of per-packet header overhead– efficient for software processing

• some wanted variable-length, up to 160 bits– compatible with OSI NSAP addressing plans– big enough for auto-configuration using IEEE 802 addresses– could start with addresses shorter than 64 bits & grow later

• settled on fixed-length, 128-bit addresses(340,282,366,920,938,463,463,374,607,431,768,211,456 in all!)

Page 70: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Benefits of IPv6 Addresses

• enough for stable, unique addresses for all devices– note: stable does not mean permanent!– allow continued growth of the Internet (for centuries to come)– restore end-to-end transparency of the Internet

• additional benefits:– plug-and-play (no need for configuration servers)– verifiable end-to-end packet integrity (no need for NATs)– simpler mobility (no need for “foreign agent” function)

IPv6: 128 bits

IPv4: 32 bits

Page 71: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Address Complexity

• IPv6 has many different kinds of addresses

– unicast, anycast, multicast, link-local, site-local, loopback, IPv4-embedded, care-of, manually-assigned, DHCP-assigned, self-assigned, solicited-node, and more.

• Most of this complexity is also present in IPv4,just never written down in one place

– a result of 20 years of protocol evolution

• one simplification: no broadcast addresses in IPv6!

– uses multicast to achieve same effects

Page 72: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IPv6 Addresses

• Classless addressing/routing (similar to CIDR)• Notation: x:x:x:x:x:x:x:x (x = 16-bit hex number)

– contiguous 0s are compressed: 47CD::A456:0124 = 47CD:0000:0000:0000:0000:0000:A456:0124

– IPv6 compatible IPv4 address: ::128.42.1.87

• Address assignment– provider-based (can’t change provider easily)– geographic

010 Registry ID Provider ID Subscriber ID Subnet ID Interface ID

3 m n o p 125-mnop

Page 73: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Prefix0000 00000000 00010000 0010000 0100000 0110000 1000100101001110010111011101111 01111 101111 1101111 1110 01111 1110 101111 1110 111111 1111

UseReservedUnassignedReserved for NSAP AllocationReserved for IPX AllocationUnassignedUnassignedUnassignedUnassignedProvider-Based Unicast Address IPV4-likeUnassignedReserved for Geographic-Based Unicast Addresses UnassignedUnassignedUnassignedUnassignedUnassignedUnassignedUnassignedLink Local Use Addresses no global uniquenessSite Local Use Addresses no global uniquenessMulticast Addresses

Page 74: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

The Main IPv6 Header

The IPv6 fixed header (required).

Page 75: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IP version 6 – Future Evolution

• The next header field provides for future evolution.

• If non-zero, it specifies an extension header type in the packet.

• The extension header types include the services for router information, route definition, fragment handling, authentication, encryption information, and destination information.

• Each extension header type has a specific size and format and is transmitted after the basic header and before the payload.

Page 76: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Extension Headers

IPv6 extension headers.

5-69

Page 77: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Extension Headers (2)

The hop-by-hop extension header for large datagrams (jumbograms).

Page 78: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Extension Headers (3)

The extension header for routing.

Page 79: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IPv6 – Multicast and Anycast

• IPv6 describes rules for three types of addressing: unicast (one host to one other host), anycast (one host to at least one of multiple hosts), and multicast (one host to multiple hosts).

• The introduction of an "anycast" address provides the possibility of sending a message to the nearest of several possible gateway hosts with the idea that any one of them can manage the forwarding of the packet to others.

• Anycast messages can be used to update routing tables along the line.

Page 80: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IP version 6 – Security

• The advantage of implementing security at the IP level is that it can be applied without the need for security-aware implementations of application programs.

• Security in IPv6 is implemented through the authentication and encrypted security payload extension header types , for ensuring data integrity, and for ensuring privacy.

Page 81: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IPv6 Sockets programming

• New address family: AF_INET6• New address data type: in6_addr• New address structure: sockaddr_in6

struct in6_addr {

uint8_t s6_addr[16];

};

Page 82: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

sockaddr_in6

struct sockaddr_in6 {

uint8_t sin6_len;

sa_family_t sin6_family;

in_port_t sin6_port;

uint32_t sin6_flowinfo;

struct in6_addr sin6_addr;

};

Page 83: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Transition from IPv4 to IPv6

• Gradual Transition with IPV4 and IPV6

• Dual Stack - (both supported on some nodes)

• Tunneling

– When v6 passes through v4 network

– Encapsulate v6 inside v4 packet with a v6 router as a destination

– destination router then sends v6 packet

– lose QoS and other desirable features in v4 segment

Page 84: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Dual Server

• In the future it will be important to create servers that handle both IPv4 and IPv6.

• The work is handled by the O.S. (which contains protocol stacks for both v4 and v6):– automatic creation of IPv6 address from an IPv4 client

(IPv4-mapped IPv6 address).

Page 85: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

IPv4client

IPv4client

TCPTCP

IPv4IPv4

DatalinkDatalink

IPv6client

IPv6client

TCPTCP

IPv6IPv6

DatalinkDatalink

IPv6server

IPv6server

TCPTCP

DatalinkDatalink

IPv4IPv4 IPv6IPv6

IPv4-mappedIPv6 address

IPv4-mappedIPv6 address

Page 86: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Multicast

• IPv4– class D addresses– demonstrated with Mbone (uses tunneling)– Place least significant 23 bits of IP number in last 23

bits of ETH/FDDI address– MSB on in Ethernet indicates multicast

• Integral part of IPv6– problem is making it scale

Page 87: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Link-State Multicast

• Each host on a LAN periodically announces the groups it belongs to (IGMP).

• Augment update message (LSP) to include set of groups that have members on a particular LAN.

• Each router uses Dijkstra's algorithm to compute shortest-path spanning tree for each source/group pair.

• Each router caches tree for currently active source/group pairs.

Page 88: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Example

A

B

C

R1 R2

R3 R4 R5

R6 R7

A

B

C

R1R2

R3 R4 R5

R6 R7

source

A

B

C

R1R2

R3 R4 R5

R6 R7

source

A

B

C

R1R2

R3 R4 R5

R6 R7

source

Page 89: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Distance-Vector Multicast

Reverse Path Broadcast (RPB)• Each router already knows that shortest path to destination S

goes through router N.• When receive multicast packet from S, forward on all outgoing

links (except the one on which the packet arrived), iff packet arrived from N.

• Eliminate duplicate broadcast packets by only letting “parent” for LAN (relative to S) forward– shortest path to S (learn via distance vector)– smallest address to break ties

Page 90: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

Reverse Path Multicast (RPM)

• Goal: Prune networks that have no hosts in group G

• Step 1: Determine of LAN is a leaf with no members in G– leaf if parent is only router on the LAN

– determine if any hosts are members of G using IGMP

• Step 2: Propagate “no members of G here” information– augment <Destination, Cost> update sent to neighbors with set of

groups for which this network is interested in receiving multicast packets.

– only happens with multicast address becomes active.

Page 91: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

RP

R3 R2 R4

R1 R5

(c)

RP

R3 R2 R4

R1 R5

(d)

RP

R3 R2 R4

R1 R5

(a)

RP

R3 R2 R4

R1 R5

(b)

Join

Join

Join

JoinJoin

Rendezvous pointRP =

Shared tree

Source-specific tree for source R1

PIM

Page 92: Internetworking Outline Internetworking by IP Routing Global Internet Multicast

RP

R3 R2 R4

R1R5

Host

RP G

RP G

G

G

G

G