Transcript Slide 1

Net-Centric Computing Division
Department of Computer Science
Bogor Agricultural University
KOM 312
KOMUNIKASI DATA
DAN JARINGAN KOMPUTER
Internet Protocol
Sri Wahjuni
my_juni04(at)ipb.ac.id; my_juni04(at)yahoo.com
AGENDA
Architecture
swj/11
 TCP/IP
 IPv4
 ICMP
 IPv6
2
Department of Computer Science -IPB
TCP/IP PROTOCOL SUITE
swj/11
3
Department of Computer Science -IPB
APLICATIONS OVER TCP/UDP
SMTP
HTTP
RTP
DNS
swj/11
TCP
UDP
IP
Network
Network
Network
Interface 1
Interface 2
Interface 3
Department of Computer Science -IPB
4
HTTP PACKET ENCAPSULATION
swj/11
5
Department of Computer Science -IPB
ADDRESSES IN TCP/IP
Alamat
(Addresses)
swj/11
Alamat Fisik
(Physical Address)
Alamat IP
(IP Address)
Alamat Port
(Port Address)
6-byte
00-16-36-4B-08-B7
4-byte (IPv4)
172.17.1.212
HTTP (80)
6
Department of Computer Science -IPB
ADDRESS RESOLUTION
swj/11
7
Department of Computer Science -IPB
HOW TO GET IP ADDRESS?
ICANN ( Internet Corporation for Assigned
Names and Numbers)
swj/11
IANA ( Internet Assigned Numbers
Authority)
ARIN (American
Registry for Internet
Number)
ISPs
LACNIC (Latin
America and
Carribean Network
Information Center)
RIPE (Reseaux
ISPs
ISPs
IP Europeens)
Department of Computer Science -IPB
AfriNIC
APNIC (Asia
(African Network
Information
Center)
Pacific Network
Information
Center)
ISPs
ISPs
8
IP ADDRESSES: HOW TO GET ONE?
Q: How does host get IP address?
hard-coded by system admin in a file



swj/11

Wintel: control-panel->network->configuration->tcp/ip->properties
UNIX: /etc/rc.config
DHCP: Dynamic Host Configuration Protocol: dynamically get
address from as server

“plug-and-play”
9
Department of Computer Science -IPB
AGENDA
Architecture
 IPv4





swj/11
 TCP/IP
Header Format
Internet Checksum
Fragmentation and reassembly
Addressing (subnetting, CIDR)
Network Address Translation
 ICMP
 IPv6
10
Department of Computer Science -IPB
IPV4 HEADER
swj/11
11
Department of Computer Science -IPB
IP ADDRESSES FORMAT
swj/11
12
Department of Computer Science -IPB
CHECKSUM
 Perform
swj/11
by summing sequence of bits using
1’s complement arithmetic
 Used to detect error in the header
 Used to protect the packet from data
corruption in transmission process
13
Department of Computer Science -IPB
Sender side
To create the checksum the sender does
the following:
swj/11
1. The packet is divided into k sections,
each of n bits.
2. All sections are added together
3. The final result is complemented
to make the checksum.
14
Department of Computer Science -IPB
Receiver side
To check the validity of the packet the receiver does
the following:
swj/11
1. The packet is divided into k sections,
each of n bits.
2. All sections are added together
3. The final result is complemented
4. The packet is valid if the result is all 0’s
15
Department of Computer Science -IPB
Checksum Mechanism
swj/11
16
Department of Computer Science -IPB
Checksum in one’s complement arithmetic
swj/11
Checksum
17
Department of Computer Science -IPB
Latihan: Berapa Nilai Checksum berikut?
swj/11
4
5
0
28
1
4
0
17
0
0
10.12.14.5
12.6.7.9
Department of Computer Science -IPB
18
Kalkulasi Checksum dalam Biner
4
5
0
1
4
1
0100 0101
0000 0000
0000 0000
000 0 0000
0000 0100
0000 0000
0000 1010
0000 1110
0000 1100
0000 0111
10
00000000
00011100
00000001
00000000
00010001
00000000
00001100
00000101
00000110
00001001
0 11 1 0 1 0 0
0 1 00 111 0
Checksum 1000 1011
10110001
19
28
0
17
0
0
Sum
10.12.14.5
12.6.7.9
Department of Computer Science -IPB
10
1
10
swj/11
carry
10
10
10
IP FRAGMENTATION & REASSEMBLY (1)

large IP datagram divided
(“fragmented”) within network
 one datagram becomes
several datagrams
 “reassembled” only at final
destination
 IP header bits used to
identify, order related
fragments
Department of Computer Science -IPB
fragmentation:
in: one large datagram
out: 3 smaller datagrams
swj/11

network links have MTU
(max.transfer size) - largest
possible link-level frame.
 different link types,
different MTUs
 Ethernet 1500 bytes, FDDI
4464 bytes
reassembly
20
IP FRAGMENTATION & REASSEMBLY (2)

Uses fields in IP header :
Identification (ID) -- 16 bits : Identifies end system originated
datagram
 Flags -- 3 bits : unused, don’t fragment (DF), more fragment
(MF)
 Offset -- 13 bits :
 Position of fragment of user data in original datagram
 In multiples of 64 bits (8 octets)
 Total Length

swj/11
21
Department of Computer Science -IPB
IP FRAGMENTATION AND REASSEMBLY
One large datagram becomes
several smaller datagrams
1480 bytes in
data field
offset =
1480/8
Note : header overhead
Department of Computer Science -IPB
swj/11
Example
 4000 byte
datagram (exclude
IP header)
 MTU = 1500 bytes
length ID fragflag offset
=4020 =x
=0
=0
length ID fragflag offset
=1500 =x
=1
=0
length ID fragflag offset
=1500 =x
=1
=185
length ID fragflag offset
=1060 =x
=0
=370
22
EXAMPLE OF IP HEADER
swj/11
23
Department of Computer Science -IPB
IPV4 ADDRESS FORMAT:
NETWORK ID DAN HOST ID
swj/11
Format terdiri 2 bagian:
 ID Network (Jaringan) : menunjukkan jaringan tempat komputer
tersebut berada
 ID Host (identitas komputer) : menunjukkan identitas unik dari setiap
peralatan (komputer) di sebuah jaringan (kenyatannya suatu interface
pd jaringan)
24
Department of Computer Science -IPB
IPV4 : PENULISAN
1. Notasi Biner
swj/11
Format:
xxxxxxxx . xxxxxxxx . xxxxxxxx . xxxxxxxx
dipisahkan setiap 8 bit dan setiap simbol “x” dapat digantikan oleh
angka 0 dan 1, misalnya:
11000000.10101000.00000011.11111101
2. Notasi Dotted Decimal
• Lebih Mudah
• IP addresses ditulis dalam bentuk notasi desimal bertitik
Format: nnn.nnn.nnn.nnn (dimana nnn = 0 s/d 255)
misalnya: 192.168.3.253
25
Department of Computer Science -IPB
IP ADDRESSING: INTRODUCTION
IP address: 32-bit
identifier for host,
router interface
 interface: connection
between host/router
and physical link
223.1.1.1

223.1.1.2
223.1.1.4
223.1.1.3
IP addresses associated
with each interface
223.1.2.9
223.1.3.27
223.1.3.1
223.1.2.2
swj/11

223.1.2.1
223.1.3.2
223.1.1.1 = 11011111 00000001 00000001 00000001
223
1
Department of Computer Science -IPB
1
1
26
BASIC CLASSES
swj/11
27
Department of Computer Science -IPB
SPECIAL IP ADDRESSES.
swj/11
28
Department of Computer Science -IPB
EXAMPLES
IP Address : 202.0.81.252
• Nomor network
: 202.0.81
• Nomor host
: 252
• Network Address : 202.0.81.0
• Broadcast Address: 202.0.81.255
Department of Computer Science -IPB
swj/11
IP Address : 44.132.1.20
• Nomor network
: 44
• Nomor host
: 132.1.20
• Network Address : 44.0.0.0
• Broadcast Address: 44.255.255.255
29
ADDRESSING AREA
IPv4
swj/11
Private
- Unregistered
- Not used in internet
- 10.x.x.x, 172.16.x.x, 192.168.x.x
Public
- Registered
- Used in internet
30
Department of Computer Science -IPB
PROBLEMS
swj/11
These leads to :
• address wasteful
(specially in class A)
• running out of IP
address (Today apply
for class A is
impossible, class B is
very hard, class C is
running out)
31
Department of Computer Science -IPB
MIAMI, FEB 3, 2011 8:00 AM
The Internet Assigned Numbers Authority
(IANA) has handed out its last IPv4 addresses,
leaving the remaining blocks to regional
registries
 Each of the five Regional Internet Registries
(RIRs) was allocated one of the final five large
blocks of about 16 million addresses

swj/11
32
Department of Computer Science -IPB
SOLUTIONS
swj/11
Short term
 Subnetting
 CIDR
 NAT
Long term
 IPv6
33
Department of Computer Science -IPB
SUBNETTING - BASIC
swj/11
Class B adressing
34
Department of Computer Science -IPB
SUBNETTING :
Allow arbitrary complexity of internetworked LANs
within organization
 Insulate overall internet from growth of network
numbers and routing complexity
 Site looks to rest of internet like single network
 Each LAN assigned subnet number
 Local routers route within subnetted network
 Subnet mask indicates which bits are subnet number
and which are host number

swj/11
35
Department of Computer Science -IPB
CASE STUDY
A university (130.50.0.0) has 35 departments
 Needs 6 bits to address each department (then 10
bits for host number)
 Each department can have maximum 1022 host (0
and 255 are NA)
 Subnet mask = network+subnet

swj/11
Subnet mask = 255.255.252.0
 Alternative : /22  subnet mask is 22 bits long

Department of Computer Science -IPB
36
SUBNET ADDRESS
Subnet 1: 130.50.4.0
 Subnet 2: 130.50.8.0
 Subnet 3: 130.50.12.0
…
 Suppose a packet addressed to 130.50.15.6 will route
to subnet 130.50.12.0

swj/11
37
Department of Computer Science -IPB
IP ADDRESSING: CIDR
CIDR: Classless InterDomain Routing
subnet portion of address of arbitrary length
 address format: a.b.c.d/x, where x is # bits in subnet
portion of address

subnet
part
swj/11
prefix
host
host
part
11001000 00010111 00010000 00000000
200.23.16.0/23
Example :
host IP address : 167.205.9.41/27
Network address: 167.205.9.32
Department of Computer Science -IPB
38
CASE STUDY
swj/11
 ISP's block 11001000 00010111 00010000 00000000--200.23.16.0/20
 case 1: A client has 800 hosts :
using classful addressing : needs 4 class C
 using CIDR : 200.23.20.0/22
 case 2: ISP has 8 clients
 needs 3 bits for addressing
 CIDR : 200.23.16.0/23 – 200.23.30.0/23
ISP's block
11001000 00010111 00010000 00000000
200.23.16.0/20
Organization 0
Organization 1
Organization 2
...
11001000 00010111 00010000 00000000
11001000 00010111 00010010 00000000
11001000 00010111 00010100 00000000
…..
….
200.23.16.0/23
200.23.18.0/23
200.23.20.0/23
….
Organization 7
11001000 00010111 00011110 00000000
200.23.30.0/23
39
Department of Computer Science -IPB
NAT: NETWORK ADDRESS TRANSLATION
rest of
Internet
10.0.0.4
10.0.0.1
swj/11
local network
(e.g., home network)
10.0.0/24
10.0.0.2
138.76.29.7
10.0.0.3
All datagrams leaving local
network have same single source
NAT IP address: 138.76.29.7,
different source port numbers
Datagrams with source or
destination in this network
have 10.0.0/24 address for
source, destination (as usual)
40
Department of Computer Science -IPB
NAT: NETWORK ADDRESS TRANSLATION

Motivation: local network uses just one IP address as far
as outside word is concerned:
swj/11
no need to be allocated range of addresses from ISP: - just one
IP address is used for all devices
 can change addresses of devices in local network without
notifying outside world
 can change ISP without changing addresses of devices in local
network
 devices inside local net not explicitly addressable, visible by
outside world (a security plus).

41
Department of Computer Science -IPB
NAT: NETWORK ADDRESS TRANSLATION
Implementation: NAT router must:

swj/11
outgoing datagrams: replace (source IP address, port #) of
every outgoing datagram to (NAT IP address, new port #)
. . . remote clients/servers will respond using (NAT IP
address, new port #) as destination addr.

remember (in NAT translation table) every (source IP address,
port #) to (NAT IP address, new port #) translation pair

incoming datagrams: replace (NAT IP address, new port #) in
dest fields of every incoming datagram with corresponding
(source IP address, port #) stored in NAT table
42
Department of Computer Science -IPB
NAT: NETWORK ADDRESS TRANSLATION
2
1: host 10.0.0.1
sends datagram to
128.119.40.186., 80
138.76.29.7, 5001 10.0.0.1, 3345
……
……
swj/11
2: NAT router
changes datagram
source addr from
10.0.0.1, 3345 to
138.76.29.7, 5001,
updates table
NAT translation table
WAN side addr
LAN side addr
S: 10.0.0.1, 3345
D: 128.119.40.186, 80
S: 138.76.29.7, 5001
D: 128.119.40.186, 80
138.76.29.7
S: 128.119.40.186, 80
D: 138.76.29.7, 5001
3
3: Reply arrives
dest. address:
138.76.29.7, 5001
Department of Computer Science -IPB
1
10.0.0.4
S: 128.119.40.186, 80
D: 10.0.0.1, 3345
10.0.0.1
10.0.0.2
4
10.0.0.3
4: NAT router
changes datagram
dest addr from
43
138.76.29.7, 5001 to 10.0.0.1, 3345
NAT: NETWORK ADDRESS TRANSLATION

16-bit port-number field:

NAT is controversial:
swj/11

60,000 simultaneous connections with a single LANside address!
routers should only process up to layer 3
 violates end-to-end argument



NAT possibility must be taken into account by app
designers, eg, P2P applications
address shortage should instead be solved by IPv6
44
Department of Computer Science -IPB
AGENDA
Architecture
 IPv4
swj/11
 TCP/IP
 ICMP
 IPv6
45
Department of Computer Science -IPB
ICMP BASIC ERROR MESSAGE FORMAT
0
8
Type
16
Code
31
Checksum
swj/11
Unused
IP header and 64 bits of original datagram

Type examples :



Type 3 : problems reaching destination
Type 11 : time-exceed problems
IP header & 64 bits of original datagram

To match ICMP message with original data in IP packet
46
Department of Computer Science -IPB
ICMP: INTERNET CONTROL MESSAGE
PROTOCOL


network-layer “above” IP:
 ICMP msgs carried in IP
datagrams
ICMP message: type, code
plus first 8 bytes of IP
datagram causing error
swj/11

used by hosts & routers to
communicate network-level
information
 error reporting:
unreachable host,
network, port, protocol
 echo request/reply (used
by ping)
Type Code description
0
0
echo reply (ping)
3
0
dest. network
unreachable
3
1
dest. host unreachable
3
2
dest. protocol unreachable
3
3
dest. port unreachable
3
6
dest. network unknown
3
7
dest. host unknown
4
0
source quench
(congestion control – not used)
8
0
echo request (ping)
9
0
route advertisement
10
0
router discovery
11
0
TTL expired
11
1
fragment reassembly time has
been excceed
47
12
0
bad IP header
Complete source : www.iana.org/assignments/icmp-parameters
Department of Computer Science -IPB
PING AND ICMP
0
8
Type
16
Code
31
Checksum
Sequence number
swj/11
Identifier
Data

Echo request: type=8; Echo reply: type=0

Destination replies with echo reply by copying data in request
onto reply message
Sequence number to match reply to request
 ID to distinguish between different sessions using
echo services

Department of Computer Science -IPB
48
EXAMPLE – ECHO REQUEST
swj/11
49
Department of Computer Science -IPB
TRACEROUTE AND ICMP

Source sends series of
UDP segments to dest

When nth datagram
arrives to nth router:
Router discards datagram
 And sends to source an
ICMP message (type 11,
code 0)
 Message includes name of
router & IP address

When ICMP message
arrives, source calculates
RTT
Department of Computer Science -IPB
swj/11
First has TTL =1
 Second has TTL=2, etc.

Traceroute does this 3
times
Stopping criterion
 UDP segment eventually
arrives at destination host
 Destination returns ICMP
“host unreachable” packet
(type 3, code 3)
 When source gets this
ICMP, stops.

o
50
AGENDA
Architecture
 IPv4
swj/11
 TCP/IP
 ICMP
 IPv6



Header format
Addressing
Transition IPv4 to IPv6
51
Department of Computer Science -IPB
IPV6
Initial motivation: 32-bit address space soon to be
completely allocated.
 Additional motivation:

swj/11
header format helps speed processing/forwarding
 header changes to facilitate QoS
IPv6 datagram format:
 fixed-length 40 byte header
 no fragmentation allowed

52
Department of Computer Science -IPB
IPV6 HEADER
swj/11
Priority: identify priority among datagrams in flow (real-time
delivery requirement)
Flow Label: identify datagrams in same “flow” (concept of “flow”
not well defined).
53
Next header: identify upper layer protocol for data
Department of Computer Science -IPB
OTHER CHANGES FROM IPV4

Checksum: removed entirely to reduce processing time at
each hop
Options: allowed, but outside of header, indicated by
“Next Header” field

swj/11

ICMPv6: new version of ICMP


additional message types, e.g. “Packet Too Big”
multicast group management functions
54
Department of Computer Science -IPB
IPV6 ADDRESSING
128 bits
 Use hexadecimal digit
 Each 4 hexadecimal digit separate by colon (:)

swj/11
Example :
Binary format:
0101100011011101 | 0000000000000000 | 0000000000000000 | 0000000000000000 |
1111111100000001 | 0000000000000000 | 0000000000000000 | 0000100010101100
Hexadecimal format :
58DD:0000:0000:0000:FF01:0000:0000:08AC
Department of Computer Science -IPB
55
ABBREVIATION
Leading zeros in 16-bit field can be removed, replace
by one numeral
 Consecutive zero-valued field can be shortened with
the double-colon notation (::)
 The double-colon notation can appears only once in
an address
 Example :
ABF5:0000:0000:0000:BA5F:039A:000A:2176
Can be shortened to :
ABF5:0:0:0:BA5F:39A:A:2176
More shortened to
ABF5::BA5F:39A:A:2176

swj/11
Department of Computer Science -IPB
56
ABBREVIATION (2)
swj/11
57
Department of Computer Science -IPB
IPV6 CIDR

Example :
FDEC:0:0:0:0:BBFF:0:FFFF /60
swj/11
58
Department of Computer Science -IPB
TYPE OF ADDRESS
 Unicast
Single interface
 Anycast



swj/11

Set of interfaces (typically different nodes)
Delivered to any one interface
the “nearest”
 Multicast
Set of interfaces
 Delivered to all interfaces identified

59
Department of Computer Science -IPB
ADDRESSING STRUCTURE
swj/11
60
Department of Computer Science -IPB
TYPE PREFIX
Type Prefix
Type
Fraction
Reserved
1/256
0000 0001
Reserved
1/256
0000 001
NSAP (Network SAP)
1/128
0000 010
IPX (Novell)
1/128
0000 011
Reserved
1/128
0000 100
Reserved
1/128
0000 101
Reserved
1/128
0000 110
Reserved
1/128
0000 111
Reserved
1/128
0001
Reserved
1/16
001
Reserved
1/8
010
Provider-based unicast addresses
1/8
011
Reserved
1/8
100
Geographic unicast addresses
1/8
101
Reserved
1/8
110
Reserved
1/8
1110
Reserved
1/16
1111 0
Reserved
1/32
1111 10
Reserved
1/64
1111 110
Reserved
1/128
1111 1110 0
Reserved
1/512
1111 1110 10
Link local addresses
1/1024
1111 1110 11
Site local addresses
1/1024
Department of Computer Science -IPB
swj/11
0000 0000
61
PROVIDER-BASED ADDRESS
swj/11
62
Department of Computer Science -IPB
SPECIAL ADDRESSES

Unspecified address :

Loopback address :


0:: 1
IPv4 compatible address :



swj/11

0::0
96 bits all 0’s : 32 bits IPv4
Example : IPv4 address 2.13.17.14
0::020D:110E
 IPv6 address
IP-mapped address :


80 bits all 0’s :16 bits all 1’s : 32 bits IPv4
Example : IPv4 address 2.13.17.14  IPv6 address
0::FFFF:020D:110E
Department of Computer Science -IPB
63
TRANSITION FROM IPV4 TO IPV6

Not all routers can be upgraded simultaneous
no “flag days”
 How will the network operate with mixed IPv4 and IPv6
routers?

swj/11
Dual-stack : RFC 2893 (IPv6/IPv4 node) : a node has
full implementation of IPv6 stack as well as IPv4 stack
 Tunneling: IPv6 carried as payload in IPv4 datagram
among IPv4 routers

64
Department of Computer Science -IPB
TUNNELING
Logical view:
B
IPv6
IPv6
A
B
C
IPv6
IPv6
IPv4
Flow: X
Src: A
Dest: F
data
Protocol value in IPv4
header = 41
A-to-B:
IPv6
E
F
IPv6
IPv6
D
E
F
IPv4
IPv6
IPv6
tunnel
Src:B
Dest: E
Src:B
Dest: E
Flow: X
Src: A
Dest: F
Flow: X
Src: A
Dest: F
data
data
B-to-C:
IPv6 inside
IPv4
Department of Computer Science -IPB
B-to-C:
IPv6 inside
IPv4
swj/11
Physical view:
A
Flow: X
Src: A
Dest: F
data
E-to-F:
IPv6
65
REFERENCES
Garcia A.L., Widjaja A. 2004. Networks
Communication.: Fundamental Concepts and Key
Architectures 2nd ed. – Chapter 8. McGraw-Hill
Companies, Inc.
 Kurose J.F., Ross K.W. 2003. Computer
Networking : A Top-Down Approach Featuring Internet
2nd ed. – Chapter 4. Pearson Education.
 Sukoco H. 08crc_kom334.ppt

swj/11
66
Department of Computer Science -IPB