why an ip layer? rocky k. c. chang 20 september 2010 1

30
WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

Upload: nigel-hoover

Post on 19-Jan-2016

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

1

WHY AN IP LAYER?

Rocky K. C. Chang 20 September 2010

Page 2: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

2

The internetworking problem Problem: How to interconnect heterogeneous

networks “effectively”? Interconnect homogeneous networks directly,

e.g., Multiple Ethernet LAN segments Multiple Fibre Channels Multiple Token Rings Two wireless LANs …

Switching / bridging LAN switches Transparent bridging, spanning tree algorithm and

source routing

Page 3: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

3

The internetworking problem Interconnect heterogeneous networks

directly, e.g., DIX Ethernet with IEEE Ethernet Ethernet with Token Ring Wired LAN with wireless LAN

Three problems with interconnection at data-link layer: Do not scale to the number of data-link

technologies. Do not scale to the number of hosts

(networks). Do not have a common addressing space.

Page 4: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

4

The internetworking problem

S2

S1

H4

H5

H3H2H1

Network 2 (Ethernet)

Network 1 (Ethernet)

H6

Network 3 (FDDI)

Network 4(point-to-point)

H7 S3 H8

Page 5: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

5

Scaling to data-link technologies Conversion between frame structures. Scalability problem as the number of

data-link technologies supported increases, e.g., Ethernet

FDDI

PPPToken ring

Frame conversion

Page 6: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

6

Scaling to network size

A switched LAN is a “flat” network---A single broadcast frame reaches every LAN. Virtual LAN (VLAN) can relieve this problem

at the expense of managing VLAN membership.

Spanning tree protocol does not scale well to network size. Take a longer time for the protocol to

converge. Take a longer time to respond to network

state changes.

Page 7: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

7

Uncommon MAC address spaces Different structures and number of bits

used in MAC address space Ethernet: 48/64 bits FDDI: 48 bits ATM: 160 bits

Each address in a data-link technology must be universally unique.

Page 8: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

8

A layer-3 solution to internetworking

R2

R1

H4

H5

H3H2H1

Network 2 (Ethernet)

Network 1 (Ethernet)

H6

Network 3 (FDDI)

Network 4(point-to-point)

H7 R3 H8

Page 9: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

9

IP: Scaling to data-link technologies

Ethernet

FDDI

PPPToken ring IP

Encapsulation and demultiplexing

Page 10: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

10

IP: Scaling to network size

IP network uses hierarchies to achieve scalability.

There are at least three levels: A single IP host

(csultra6.comp.polyu.edu.hk) A IP subnet (four subnets in

comp.polyu.edu.hk) An autonomous system (polyu.edu.hk)

Page 11: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

11

IP: Uncommon MAC address spaces

Create a logical (unicast) address space to identify network interfaces.

Classes A-C for unicast and class D for multicast: Network Host

7 24

0(a)

Network Host

14 16

1 0(b)

Network Host

21 8

1 1 0(c)

28

1 1 0(d) 1

Page 12: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

12

Directly connected IP hosts

IP

ETH

TCP

H1

IP

ETH

TCP

H2

FTP FTPFTP

TCP

IP

Ethernet protocol

Page 13: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

13

Indirectly connected IP hosts

R1

ETH FDDI

IPIP

ETH

TCP

R2

FDDI ETH

IP

H1

IP

ETH

TCP

H2

FTP FTPFTP

TCP

IP

FDDI protocol

Page 14: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

14

Encapsulation

Data is processed at each layer through the protocol stack, until it is sent as a stream of bits across the network.

Each layer adds information to the data by prepending headers (and sometimes trailers) to the data that it receives.

A lower-level protocol does not interpret the message it is given by some higher-level protocol.

Page 15: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

15

Encapsulation

IP

ETH

TCP

FTP

Appl. data

Appl. dataTCP hdr

Appl. dataTCP hdrIP hdr

Appl. dataTCP hdrIP hdrEth. hdr

user input

Send out to the network interface

Page 16: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

16

Demultiplexing

Appl. data

Appl. dataTCP hdr

Appl. dataTCP hdrIP hdr

Appl. dataTCP hdrIP hdrEth. hdr

Received from the network interface

Other nonIP network protocols

UDP-based applications

Other TCP-based application processes

Page 17: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

17

Internet addresses and port numbers

Each network interface has at least one IP address.

Both TCP and UDP use 16-bit port numbers to identify applications.

Servers are normally known by their well-known port numbers, usually between 1 and 1023.

Client ports are referred to ephemeral ports, i.e., short lived, which use port numbers above 1023.

Page 18: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

18

IP software at end hosts

The IP software mainly consists of modules for Application layer, such as DNS Transport layer: TCP, UDP Routing layer: IP, ICMP, and others. Data-link layer: MAC-IP-addresses binding

IP addresses MAC addresessHost namesDNS ARP

RARP

Page 19: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

19

An example

A HTTP client is running in m1.sun.com to connect to a HTTP server at www.sun.com.

The DNS client at m1.sun.com first obtains the IP address of www.sun.com.

The application data (HTTP+TCP) will then be encapsulated by an IP datagram with

www.sun.com m1.sun.com

140.20.1.1 140.20.1.2

Page 20: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

20

An example

IP source address = 140.20.1.2 IP destination address = 140.20.1.1

Now m1.sun.com needs to run ARP to obtain the MAC address of www.sun.com’s network interface to the LAN.

The IP datagram is then encapsulated in an Ethernet frame with MAC source address = that of m1.sun.com MAC destination address = that of

www.sun.com

Page 21: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

21

IP Software at routers

The software at routers is mainly used for routing and datagram forwarding.

Each router is running at least a “routing protocol” to construct a routing (or forwarding) table. Each entry in a routing table consists of IP

destination address and the next-hop’s IP address.

Upon receiving a datagram, a router forwards it based on a set of forwarding rules and the routing table.

Page 22: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

22

Network programming

Two most common network APIs: Sockets and X/Open Transport Interface (XTI), a slight modification of AT&T’s Transport Layer Interface (TLI).

The APIs allows programmers to easily make “connections” with another application process, without knowing how the underlying network operates.

Page 23: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

23

Basic socket calls for a client

socket

connect

recvsend

peer

sockaddr_in{}

obtain a socket

establish a connection to the peer

receive and send data

Page 24: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

24

Basic socket calls for a server

socket

listen

recvsend

peer

sockaddr_in{}

obtain a socket

mark the socket as a listening socket

receive and send data

bind

accept

local

sockaddr_in{}bind the server’s IP address and port to the socket

accept new connections

Page 25: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

2510 choices that were critical to the Internet’s success

Page 26: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

26

10 right choices (by Scott Bradner)

1. Make it all work on top of existing networks (about networks, not a network).

2. Use packets, not circuits.3. Create a routing function.4. Split TCP and IP.5. The NSF funded the UC/Berkeley to put

TCP/IP into the Unix OS.6. CSNET connected with ARPANET (email

only).

Page 27: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

27

10 right choices (by Scott Bradner)

7. The NSF required users of the NSFNET to use TCP/IP.

8. Intl. telecomm standard bodies rejected TCP/IP, then created OSI.

9. The NSF created an “Acceptable Use Policy” restricting NSFNET use to noncommercial activities.

10. Once things started to build, government stayed mostly out of the way.

Page 28: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

28

Summary

Explained the need for an IP layer. Discussed the additional requirements

for running an IP layer. Discussed the factors responsible for IP’s

success in solving the internetworking problem.

Page 29: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

29

Exercises this week

Try out the following commands (with various options) and network diagnosis tools: ipconfig netstat arp ping (ICMP, UDP, TCP, HTTP) traceroute (tracert, pathping,

ICMP/TCP/UDP, etc) wireshark

Page 30: WHY AN IP LAYER? Rocky K. C. Chang 20 September 2010 1

30

Acknowledgments

Thanks to all the sources where the diagrams were extracted from.

URL for the 10 choices http://www.interesting-people.org/archives/

interesting-people/200209/msg00018.html