Professional Documents
Culture Documents
M NG IP B Giao TH C TCP - IP PDF
M NG IP B Giao TH C TCP - IP PDF
Chng4:MngIP
1
Nidung:MngIP
Lthuyt
BgiaothcTCP/IP
Lplinmng
GiaothcIP
CutrcgitinIP
Lpvnchuyn
GiaothcUDP
GiaothcTCP
Lpngdng
MinhhahotngcamngIP
2
Mngmytnh
10.0.0.2 10.0.0.3
Host
12.0.0.3 12.0.0.4
M ng10
10.0.0.1
16.0.0.3 16.0.0.5
Router M ng12
12.0.0.5
12.0.0.7
M ng16
16.0.0.2
3
BgiaothcTCP/IP
Bgiaothciukhintruynthng/giao
thcInternet(TCP/IP)lmttndng
chungchomthccgiaothctiu
chunchovictraoithngtingiamy
tnhmytnh.
Hinnay,TCP/IPcsdngrtph
bintrongmngmytnh,minhnhl
mngInternet.
1. TCP:TransmissionControlProtocol:Giaothciukhintruyndn
2. TCP/IPprotocolsuite:Chng/bgiaothcTCP/IP 4
BgiaothcTCP/IP
BgiaothcTCP/IP:TCP/IPProtocolSuite
5
BgiaothcTCP/IP
TCP/IPcphttrintrcmhnhOSIcc
tngtrongTCP/IPkhngtngnghontonvi
cctngtrongmhnhOSI
BgiaothcTCP/IPcchiathnhbntng:
Lp4Applicationlayer(lpngdng)
Lp3Transportlayer(lpvnchuyn)
Lp2InternetLayer(lpInternetikhicgil
lplinmng)
Lp1NetworkAccessLayer/NetworkInterfaceand
Hardware(lptruynhpmng,ikhicgillp
giaodinmng)
6
BgiaothcTCP/IP
A pplicationlayer
NFS
Ping SMTP FTP Telnet NNTP etc... DNS TFTP BOOTP etc...
RPC
Internetlayer IP
ARP RARP
Media
7
(physical)
BgiaothcTCP/IP
Nhnxt:
BgiaothcTCP/IPlskthpcaccgiao
thckhcnhaucclpkhcnhau,khngch
cccgiaothcTCPvIP.Milplicchc
nngring.
Huhtccdliutruyntrnbgiaothc
TCP/IPuktthcnggidliuIP(IP
datagram),trARPvRARPcnggitrc
tipKhunglplinkt(LinkLevelFrames)
8
BgiaothcTCP/IP
ichiuvimhnhOSI
TCP TCP
IP IP
Ethernet Ethernet
Driver Driver
implementation
10
uimcaktnimngIP
GiaothcIPcsdngrngritrnphmvi
toncuchoktnimngdliuv:
mngsdnggiaothcIPloibranhgiigiadch
vsliuvthoi
giaothcIPclpvilplinktdliu
ccmngIPcxydngdatrncctiuchun
toncucaIETF
phncngvphnmmIPcungcptincyv
chtlngdchvsliucaohntrcy
11
Lplinmng:GiaothcIP
LplinmngtrongchnggiaothcTCP/IP
tngngvilpmngtrongmhnhOSI.
Chcnngchnhcalplinmnglnh
achlgicvnhtuyngitich.
Giaothcngchnhtlplinmng
chnhlgiaothclinmng(IPInternet
Protocol).
Ngoiracncmtsgiaothckhcnh
ICMP,ARPvRARP. 12
Ccgiaothclplinmng
GiaothcInternet(IP)lgiaothc
chuynmchgiphiktni
khngtincy
datrnnguynlnlcttnht.Nlcnht
ycnghaIPkhngcungcpchcnngtheodi
vkimtrali.Nchcgngchuyngitich
chkhngcsmbo.
Giaothcnylmvictilpmng,tng
ngvilp3trongmhnhOSI
IP:InternetProtocol
OSI:OpenSystemInterconnection
13
Nutincylyutquantrng,IPphi
hotngvimtgiaothclpphatrntin
cy,chnghnTCP.
Shiunhndngcsdnglplin
mngcabgiaothcTCP/IPcgil
achlinmng(achIP).
achnhphn32bt
cthcthitrongphnmm
dngnhdanhduynhtvtonccmt
trmhocmtroutertrnlinmng
14
Ccgiaothclplinmng
GiaothcICMP:Giaothcthngboiukhinlinmng
(InternetControlMessageProtocol).
GiaothcIGMP:QunlccnhmchotruynMulticast
rarp reply
GiaothcARPvRARP to:8:0:20:3:f6:c1,
Your IP address is:
arp: who has arp reply to 192.168.12.42
FTP FTP 192.168.12.17:
192.168.12.13?
tell me! 192.168.12.13 is
TCP (Im TCP 8:0:20:16:c3:52
192.168.12.17) rarp: Im 8:0:20:3:f6:c1
IP IP Whats my IP address?
RARP RARP
ARP ARP
server
Ethernet Ethernet Ethernet Ethernet
15
A (12.17) B (12.13) C (12.1) D (12.42)
Lplinmng:GiaothcIP
GiaothcIP
IPcthitknhmmcchsdngchiu
qutinguynmng.
Giaothcnychaithiuht:thiuiukhin
livthiucccchhtr;IPcngthiuc
chtruyvn.Mttrmikhicnxcnhxem
routerhocmttrmkhcchotngkhng.
Mtngiqunlmngikhicnthngtint
mttrmhocrouterkhc.
16
GiaothcIP
Data
destination: 203.162.0.11
source: 192.168.1.2
= hosts/routers
Data on a network
17
M ng Trm
192.168.1 1
192.168.3 1
1
192.168.5 2
3
Ethernet
192.168.5.0
192.168.1.0
Token
192.168.5.3
Ring
192.168.5.1 192.168.1.1
192.168.3.1
192.168.5 .2
18
Ethernet 192.168.3.0
LplinmngCutrcgitinIP
in 32 bit words, so Choose: min delay,
max hdr len is max throughput,
____ bytes? max reliability, flags for fragmentation
min cost.
Version
= 4 32
4 4 8 3 13
total length (bytes) offset from start
orig dgram id: version hdr len type of service of orig dgram
keeps
fragments identification flags fragment offset
together
time-to-live protocol header checksum
covers
prevents inf. source IP address header only
loops
destination IP address
e.g. special
- options (if any)
-
routing,
recording
timestamps - data (if any) -
19
LplinmngCutrcgitinIPv4
Phinbn(Version):ChphinbncagiaothcIP
dngtodatagram.
dimouIP(IPHeaderLength):Cungcpthng
tinvdimoucadatagram,ctnhtheocc
t32bit.
Loidchv(TypeofServiceServicetype):xcnh
utincadatagramvxcnhkiugiaothngca
datagram.delay,maxthroughput,maxreliability,min
cost.
Tngdi(TotalLength):Gmtngsoctetcaphn
tiuvdliu.
Nhndng(Identification):GitrIDdatagrambanu
C(Flag):nhduphnmnh.
20
LplinmngCutrcgitinIPv4
Fragmentoffset:lchtimkhiucadatagram.
Timetolive:Thigiansng.
Protocol:Giaothc
Headerchecksum:tngkimtra(chgmphnheader).
Tnhtontngkimtra
achIPngunvchxcnhngunvchn
cagiIP,c32bit.
Tychn(Optiontia40byte):Khaibocctychn
dobngiyucunuc.
Dliu(Data):Nuc(dliucalptrn)..
21
LplinmngachIP
MiachIPgm4byte(32bt),nh
nghahaiphn:
achmng(NetID)
achtrm(HostID)
Ccphnnycchiudikhcnhautu
thucvolpach.
Ccbtutintrongphnachmng
xcnhlpcaachIP.
22
LplinmngachIP
ScnthitcachIP:
mcngdng,cthcoilinmnglmt
mngnlktnicctrmvinhau.
mttrmtruynthngvitrmkhc,cn
cmththngnhdanhtoncu(ttn
duynhtchomitrm)khngthsdng
tngmngvtrnmngcncccthcth
khcnhrouter
23
LplinmngachIP
ScnthitcachIP(2):
Mtlinmngctonntskthpca
ccmngvtl(LANhocWAN)thngqua
ccrouter
Khihaitrmtruynthngvinhau,gidliu
quaccmngvtlkhcnhaubngcchs
dngccrouternyvictruynthngti
mcnycngcncmththngnhdanh
toncc
24
LplinmngachIPv4
012347152331
Lp 0 achmng achtrm(24bt)
A
Lp 1 0 achmng achtrm(16bt)
B
Lp 1 1 0 achmng achtrm
C (8bt)
LpD 1 1 1 0 achmulticast(28bt)
LpE 1 1 1 1 Chasdng(28bt)
25