Introduction to Internet and TCP/IP

Download Report

Transcript Introduction to Internet and TCP/IP

1
WHY AN IP LAYER?
Rocky K. C. Chang
20 September 2010
The internetworking problem
2


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
The internetworking problem
3

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.
The internetworking problem
4
Network 1 (Ethernet)
H7
H2
H1
H3
Network 4
(point-to-point)
Network 2 (Ethernet)
S1
S2
H4
Network 3 (FDDI)
H5
S3
H6
H8
Scaling to data-link technologies
5


Conversion between frame structures.
Scalability problem as the number of data-link
technologies supported increases, e.g.,
Ethernet
PPP
Token ring
FDDI
Frame conversion
Scaling to network size
6

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.
Uncommon MAC address spaces
7

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.
A layer-3 solution to internetworking
8
Network 1 (Ethernet)
H7
H2
H1
H3
Network 4
(point-to-point)
Network 2 (Ethernet)
R1
R2
H4
Network 3 (FDDI)
H5
R3
H6
H8
IP: Scaling to data-link technologies
9
Ethernet
Token ring
IP
FDDI
Encapsulation and demultiplexing
PPP
IP: Scaling to network size
10


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)
IP: Uncommon MAC address spaces
11


Create a logical (unicast) address space to identify
network interfaces.
Classes A-C for unicast 7and class D for
24 multicast:
(a)
(b)
(c)
0
1
1
Network
0
1
Host
14
16
Network
Host
0
21
8
Network
Host
28
(d)
1
1
1
0
Directly connected IP hosts
12
H1
H2
FTP
FTP
FTP
TCP
TCP
TCP
IP
IP
IP
ETH
Ethernet protocol
ETH
Indirectly connected IP hosts
13
H1
H2
FTP
FTP
TCP
TCP
IP
IP
ETH
FTP
ETH
R1
FDDI
TCP
IP
FDDI protocol
IP
FDDI
R2
IP
ETH
ETH
Encapsulation
14



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.
Encapsulation
15
user input
FTP
Appl. data
TCP
TCP hdr
Appl. data
IP hdr
TCP hdr
Appl. data
IP hdr
TCP hdr
Appl. data
IP
ETH
Eth. hdr
Send out to the network interface
Demultiplexing
16
Other TCP-based application
processes
Appl. data
UDP-based applications
Other nonIP network
protocols
Eth. hdr
IP hdr
IP hdr
TCP hdr
Appl. data
TCP hdr
Appl. data
TCP hdr
Received from the network interface
Appl. data
Internet addresses and port numbers
17




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.
IP software at end hosts
18

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
Host names
DNS
ARP
IP addresses
MAC addresess
RARP
An example
19
www.sun.com
140.20.1.1



m1.sun.com
140.20.1.2
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
An example
20
 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
IP Software at routers
21


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.
Network programming
22


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.
Basic socket calls for a client
23
obtain a socket
socket
sockaddr_in{}
establish a connection
to the peer
connect
receive and send data
recv
send
peer
Basic socket calls for a server
24
obtain a socket
socket
sockaddr_in{}
bind the server’s IP
address and port to the
socket
bind
mark the socket as a
listening socket
listen
local
sockaddr_in{}
accept new
connections
receive and send data
accept
recv
send
peer
25
10 choices that were critical to the
Internet’s success
10 right choices (by Scott Bradner)
26
1.
2.
3.
4.
5.
6.
Make it all work on top of existing networks
(about networks, not a network).
Use packets, not circuits.
Create a routing function.
Split TCP and IP.
The NSF funded the UC/Berkeley to put TCP/IP
into the Unix OS.
CSNET connected with ARPANET (email only).
10 right choices (by Scott Bradner)
27
7.
8.
9.
10.
The NSF required users of the NSFNET to use
TCP/IP.
Intl. telecomm standard bodies rejected TCP/IP,
then created OSI.
The NSF created an “Acceptable Use Policy”
restricting NSFNET use to noncommercial activities.
Once things started to build, government stayed
mostly out of the way.
Summary
28



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.
Exercises this week
29

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
Acknowledgments
30


Thanks to all the sources where the diagrams were
extracted from.
URL for the 10 choices
 http://www.interesting-
people.org/archives/interestingpeople/200209/msg00018.html