Title: 1. Internetworking
1Outline
1. Internetworking 2. Internet Protocol 3.
Fragmentation 4. Address Mapping 5. ARP vs
RARP 6. Debug Tools
2Internetworking
Internetworking ??? ???????????? network ???????
network ???? ? ??????????? Physical ??? Data
Link Layer ????????????????????????? network
???????????????? (Hop-to-hop) ??????
3Network Layer ?? Internetworking
Network Layer ????????????????????????????????????
???????????
4????????????????? Network Layer ?????????????????
???????????????????????? Packet
???????????????????? protocol ???? ?????? Header
?????????????? Logical Address ???????????????????
??????????????????? (Routing Information)
????????? Routing Table ????????????????????????
Logical Address ??????????
5????????????????? Network Layer ?? Router
?? Router ??????????? Packet ?????????????????????
??????? Routing Table ???????????????? Header
????????????? Routing information
?????????????????????????????????????????
6Internet Protocol version 4 (IPv4)
Internet Protocol version 4 ??????????????????????
??????? TCP/IP protocol ?????????????? TCP/IP
??????
7Datagram
Packet ?? IPv4 ????????????? ????????? (Datagram)
??????????????
8?????????????? ? ?? Datagram
- ????? VER (Version) ???????????????????
- ????? HLEN (Header length) ???????????????????
- ????? DS (Differentiated service)
??????????????????? - ????? Total length ????????????????????????????
- ????? identification, Flag ??? offset
????????????????????? - ????? TTL(time of live)?????????????????????????
??????????????????????????????????? - ????? Protocol ?????????????????????????????????
?????????????????????
9?????????????? ? ?? Datagram
- ????? Header checksum ??????????????????????????
??????????????????????? ???????????????? (data) - ????? Source address ?????????????????????????
- ????? Destination address ??????????????????????
???? - ????? Option ???????????????????????????????????
???
10?????????????????? checksum ?? Datagram
11?????????????? (Fragmentation)
?? IP datagram ??????????????????????????????????
(MTU) ??????????????????????????? (Encapsulate)
???????? MTU ?? Protocol ???? ?
12??????????????????????
??????????????????????????????????????????????????
??????????????? ??????????????????????????????
Packet ???? ? ????????????????????????????? 4000
byte ??????????? byte ??? 0000 3999
??????????????????? 1400 byte ????????????????????
?????????
13??????????????????????
14Address Mapping
?? Network Layer ????? Logical Address
??????????????????????????????????
????????????????????????? Data Link Layer
????????????? Physical Address ?????????????????
??? Physical Address (MAC Address)
???????????????????????????? Logical Address (IP
Address) ??????? Address Mapping Protocol
????????? ARP (Address Resolution Protocol)
15??????????? ARP
??????????????????, Packet ARP ???????????
broadcast ??? IP Address ?????????????????????????
????????? MAC Address
16?????? Packet ??? ARP
Hardware Type - Ethernet is type 0x0001 Protocol
Type- IPv40x0800 Hardware Lengthlength
of Ethernet Address (0x06) Protocol Lengthlengt
h of IPv4 address (0x04)
17?????? Packet ??? ARP
- HTYPE (hardware type) ?????????????????????????
ARP ????????? - PTYPE (protocol type) ??????????????????? ARP
??????????????????????????? - HLEN (hardware length) ???????????????????????
Physical Address ?????????????????????????????????
0x06 - PLEN (protocol length) ?????????????????????????
??????????????????????????? ??????????????????????
?????? IP ????????????? 0x04 - OPER (operation) ???????????????????????? ARP
??????? 4 ??? ??? - 01 ??????? ARP Request ????????????? MAC
Address - 02 ??????? ARP Replay ???????????????????????
MAC Address - 03 ??????? RARP Request ???????????????????????
???????? - 04 ??????? RARP Replay ?????????????????????????
???????? ???????? - sender hardware address MAC Address ?????????
- sender protocol address IP Address ?????????
- target hardware address MAC Address ?????????
- target protocol address IP Address ?????????
18?????? ARP packet ????????????
ARP packet ???????????????????? Data ?? Data Link
frame ????????????????? (Type)???? 0x0806 ??????
194 ???????????? ARP
20???????? ARP
ARP Request ????????? MAC Address
???????????????? 0 ???????????
21Example 1
A host with IP address 130.23.43.20 and physical
address B23455102210 has a packet to send to
another host with IP address 130.23.43.25 and
physical address A46EF45983AB (which is
unknown to the first host). The two hosts are on
the same Ethernet network. Show the ARP request
and reply packets encapsulated in Ethernet frames.
See Next Slide
22Example 1 (Continued)
SolutionFigure 7.7 shows the ARP request and
reply packets. Note that the ARP data field in
this case is 28 bytes, and that the individual
addresses do not fit in the 4-byte boundary. That
is why we do not show the regular 4-byte
boundaries for these addresses. Also note that
the IP addresses are shown in hexadecimal. For
information on binary or hexadecimal notation see
Appendix B.
See Next Slide
23Figure 7.7 Example 1
24Proxy ARP
???????????? ????????????? IP Address ??? MAC
Address ????? Protocol ???? RARP, BOOTP, DHCP
257.3 RARP
RARP finds the logical address for a machine that
only knows its physical address. This if often
encountered on thin-client workstations. No
disk, so when machine is booted, it needs to
know its IP address (dont want to burn the IP
address into the ROM). RARP requests are
broadcast, RARP replies are unicast. If a
thin-client workstation needs to know its IP
address, it probably also needs to know its
subnet mask, router address, DNS address, etc. So
we need something more than RARP. BOOTP, and now
DHCP have replaced RARP.
26Figure 7.10 RARP operation
27Error Reporting
Error Reporting ??????????????????????????????????
?????? IP protocol ?????????????????????????????
? ???????????????????? protocol
??????????????????????????????????????? ??? ICMP
(Internet Control Message Protocol ) ICMP
??????????????
28??????????????????????? (Error Reporting Message)
- - Destination unreachable ??? Router
????????????????????????????????? - - Source quench ??? ??????, ??????? ??? Router
???????????????????? - - Time exceeded ??? ??????????????? Router
???????????????????????????? packet ????????
?????????????????? ????????????????? - Parameter problems ??? ?? header ??? datagram
???????
29???????????? (Query Message)
- - Echo req. and rep. ??? ????????????????????????
???????????????? ?????????? ping - - Timestamp req. and rep. ??? ???????????????????
???????? - - Address-mask req. and rep. ??? ?????? Mask ???
IP Address ???? - Router solicitation req. and rep.
????????????? Redirection message
30Debugging Tools
?? Internet ????? Debug ???????????????????? ?
???????????? Router ???? ??????????????? ?
?????????????????????? ICMP ??? ping ???
traceroute ping ????????????????????????????????
??????? traceroute ???????????? UNIX ????
tracert ?? Windows ?????????????????????????????
packet ?????????????????????
31ping
32traceroute
33traceroute
34?????????
- ???????? Datagram ?????????????????
- Ox45 00 00 54 00 03 58 50 20 06 00 00 7C 4E 03 02
B4 OE OF 02 - ????
- Version ??? IP
- ?????????? Datagram ???????
- ??????? Service ????????? Protocol ??
- IP Address ????????? ??????????
35Datagram
Packet ?? IPv4 ????????????? ????????? (Datagram)
??????????????
360100 0101 x00 x00 54 x00 54
x00 03 x00 03 x00 03 010 1 1000 x50
x20 x20 x06 x00 00 x00 00
7C 4E 03 02 7C 4E 03 02 7C 4E 03 02 7C 4E 03 02 7C 4E 03 02
B4 0E 0F 02 B4 0E 0F 02 B4 0E 0F 02 B4 0E 0F 02 B4 0E 0F 02
37DNS (Domain Name System)
- DNS ????????????????????????????? IP address ????
????????? - DNS ?????? Internet ??????????????????????????
??? - ???????????????? server ???????????????????????
- ????? server ?????????????????????? DNS protocol
- ????? server ?????????????????????????? client
38??????????? DNS
http//www.chanthaburi.buu.ac.th
Name Server
Client (PC)
www.chanthaburi.buu.ac.th
10.201.1.31
IP 10.201.1.31 , TCP, Port 80
39???????????? DNS
- DNS ??????????????????????????????????????????????
?? - ??????????????????????????????????????????????????
??????????? - ???????????????????????????????????????????
????????? - ???? www.chanthaburi.buu.ac.th ??????? ?????????
www ??????? chanthaburi.buu.ac.th
40???????????? DNS
41???? domain
- ????? node ?? namespace ??????????????????????????
?????? ??? (root) ??????????????????????????????
?????????????? node ????????????????? . - ????????? ??? ????????????????????????????????????
????????????????????????????????????????
????????????????????????????????????? . ????
kmutnb.ac.th
???
th
????? kmutnb.ac.th
ac
go
???? kmutnb.ac.th
kmutnb
42???????????? DNS
43???? domain
- ???????? ???????????? domain ????????????????????
IP address ?????????? ????????????????????????
domain ??????????? ???? - www.ee.eng.chula.ac.th
- ????????????????????? www ??????????????
ee.eng.chula.ac.th - ftp.nectec.or.th
- ???????????????? ftp ?????????????? nectec.or.th
44????????????? ??? ?????????????
- ??????????????????????????????????????????????????
????? - ???????? ????????????????? (absolute domain
name) - ???????????????????????? FQDN
(fully-qualified domain name) - ??????????????????????????????????????????????????
??????????????????? ???? cit.kmutnb.ac.th.
45????????????? ??? ?????????????
- ????????????????????????????????
????????????????? (relative domain name) - ??????????????????????? cit ?????? DNS ???????
kmut.ac.th. ?????? - ??????????????????????? DNS ??????????????????????
????? ?????? UNIX ????????? /etc/resolv.conf
46????????????????
- ??????????????????????????????????????
???????????? (top level domain)
??????????????????????????????????????????????????
- ??????????????????????? 3 ?????
- ??????????? ???????????????????????????????
- ??????????? (generic domain) ?????????????????????
?????????? Internet - ??????????? (country domain) ????????????????????
47??????????? (Generic Domain)
- Internet ?????????????????????????????? 7 ?????
- com ????????????????? (microsoft.com)
- edu ?????????????? (mit.edu)
- int ?????????????? (nato.int)
- net ????????????????? (sura.net)
- org ?????????????????????? (linux.org)
- gov ?????????????? (whitehouse.gov)
- mil ???????????? (army.mil)
48??????????? (country domain)
- ????? Internet ???????????????????????????????????
??????????????????? ??????????????????????????????
???????? ISO 3116 - at ???????? -- de ???????
- au ?????????? -- es ????
- br ?????? -- fr ????????
- ca ??????? -- it
?????? - ch ?????????????? -- kr ??????
- ??????????????????????????????????????????????????
???????????????????????????????????? ????
?????????????????????? th ????????????????????????
?????????????????
49Domain Delegation
- ??????????????????? ??????????????????????????????
????????????? ???????????? ????????????????????
(domain delegation) - ?????????????? ???????????????????? ???
????????????????????????????????????????????????
??????????????????????????????????????????????????
?????????????????????????????????????????
50Domain Delegation
- ?????????????????????????????????????????????
51Domain Delegation
- ????????????????????????????????????????????
52??? (Zone)
- ??? ??? ???????????? DNS ?????????????????????????
? ???? ????????????????????????????????????? - ?????????????????? ??? ?????????????????? 2 ????
mit.edu - ???????????????????????????????????????
???????????????????? name server ???????? ???
????????????????????????????????????? ip address
???????????????
???
th
????? kmutnb
ac
go
??? kmutnb
kmutnb
53Name Server
- ??????????????????????? ??????????????????
(master name server) ???????????????????? ???
????????????????? (slave name server) - ??????? name server ???? ??? ?????????????????????
????????????????????????????????
??????????????????????? - 1 ??? ?? name server ???????????? 1 ???????
??????????? name server ????????????????? - ??????????????????????????????????????????????????
?????? name server ????????????
???????????????????? name server
???????????????????????????????????? name server
???????????????? ???????? ????????????? (zone
transfer)
54??????????? DNS
55??????????? DNS
- ????????????????? DNS ??????????
- resolver (??????????) ??? client ??????????? DNS
- ?????????? resolver ??????????????????????????????
???????????????????? name server
?????????????????????????????????????????? - Resolver ?? UNIX ????????? /etc/resolv.conf
???????????????????????????????????
???????????????? name server ?? - /etc/resolv.conf
- domain kmutnb.ac.th
- nameserver 202.44..
- nameserver 202.44.
56??????????
- name server ??????????????????????????????????????
??????????????????????????????????????????????????
?????????????????????? namespace
??????????????????????????????????????? - ?????????????????? name server ????????
????????????(name resolution) ???? ?????????? ???
resolution - Name server ??????????????????????????????????????
????????????? ??????????????????? IP ?????????
name server ????????????????????? root name server
57Root name server
- Root name server ????????????? IP address ???
name server ??????? ???? name server
????????????????? ??? IP address ??? name server
?????????????????? - Root name server ?????????????????????????????????
??????? ??? root name server ?????????????????????
?????????????????????????? Internet ???????????
????????????? Internet ????? root name server
?????????????????
58??????????? Resolver
- ?????????????? 2 ??? ???
- ???????? (Iterative)
- ??????????? (Recursive)
- ???????? (Iterative)
- Resolver ?????????????????? name server ??? name
server ??????????????? ??????? IP address ???
name server ????????? resolver ?????????????? - ??????????? (Recursive)
- Resolver ?????????????????? name server ??? name
server ??????????????? name server
??????????????? root name server ???
??????????????????????????? ??????????????????????
???????????? resolver
59???????????? (inverse address)
- ???????????????????????? 2 ?????? ???
- ?? IP address ??? ????
- ??? ?? ???? ??? IP address
- ????????????????????? ??? IP address
?????????????????????????????????? DNS
(in-addr.arpa)
60???????????? (inverse address)
61???????????? (inverse address)
root
arpa
???????????????? IP 202.44.36.20
???????????????? ????? 20.36.44.202.in-addr.arpa
in-addr
202
44
36
20
cit.kmutnb.ac.th
62???????????????????????
- ?????????????????????????????????????? DNS
????????????????????????????? nslookup ??? dig
(??????? windows ?????????????) - Nslookup ????????????????????? IP address ??????
IP address ???????????????
63nslookup
64nslookup
- ????????????????????????????????????
?????????????? - set type ????????????????????? ????
- set typens , set typemx , set
typesoa, , etc.
65nslookup
- ?????? server ???????????????? name server
66Exercise 1
- ????? nslookup ?????????????????????????
google.com - ??????? IP address ??? Name server ????
- ??????? IP address ??? Name server ???
- Email ????????????????? google.com
- DNS Update ???????????????????????
- Name server ????? update ???????????? Name server
???????? ?????????? - ???????????????????? cache ???????????????????????
?? Name server ????????
67Exercise 2
- ????? nslookup ?????????????? IP address ??? mail
server ??????? google.com - ????????????????? ??? www.kmutnb.ac.th ??? IP
address - ???????????????? IP address 202.44.36.20