Lektion 1-Introduktion

Download Report

Transcript Lektion 1-Introduktion

Multimedie- och
kommunikationssystem, lektion 8
Repetition av TCP/IP-modellens 5 nivåer
Adressering på Internet:
MAC-adresser, IP-adresser, subnet-masker, NAT, DNSnamn, portnummer, URL:er.
Figure 2.2
TCP, UDP
IP
Ethernet
Internet layers
Figure 2.4
An exchange using the Internet model
Lager 1
Det fysiska lagret ansvarar för transmission av
enskilda databitar från en nod till nästa.
Detta kan innefatta:
•Kontakter
•Elektriska nivåer
•Modulation
•Multiplextekniker
•Bitsynkronisering
•Kretskoppling
Lager 2
Datalänklagret är protokoll för transmission av ramar
(frames) från en nod till nästa. Detta kan innefatta:
•Fleraccessprotokoll (multiple access control=MAC)
för att undvika kollisioner
•Adressering inom LAN:et/länken (nätverkskortens
fysiska MAC-adresser eller nivå 2-adress).
•Felhantering (t.ex. vid trådlös kommunikation eller
telefonnätsmodem)
Exempel: Ethernet ligger på lager 1 och 2.
Figure 2.8
Example 1
I Figure 2.8 sänder en nod med fysisk adress 10 en ram (dvs ett
paket på nivå 2) till en nod med fysisk adress 87. De två noderna är
förbundna med en länk. Ramens huvud (header H2) innehåller bl.a.
avsändarens och mottagarens fysiska adress. Ibland används en
svans (trailer T2) som innehåller felrättande och/eller
felupptäckande kod.
Lager 3
Nätverkslagret ansvarar för
vidareförmedling av paket “end-to-end”, dvs
via kedjan av datalänkar från den
ursprungliga källan till den slutliga
destinationen. Detta innefattar WANadressering (t.ex. IP-adresser) och
routingprotokoll.
Exempel: IP-protokollet.
Figure 2.11 Example 2
I figur 2.11 vill vi sända data från
en nod med logisk nätverksadress
(IP-adress) A och fysisk adress 10
till en nod med IP-adress P och
fysisk adress 95. De två enheterna
befinner sig i olika LAN. Därför
kan vi inte enbart använda deras
fysiska adress. Den fysiska
adressen kan enbart användas vid
kommunikation inom ett LAN.
De två routrarna förstår av IPadressen vilken väg paketen ska
vidareförmedlas, och ändrar
paketets fysiska adressering.
Lager 4
Transportlagret ansvarar för leverans av
meddelanden “end-to-end”, från en process på
avsändardatorn till en process på mottagardatorn.
Detta kan innefatta:
•portnummer,
•virtuell kretskoppling, dvs flödesstyrning,
felkontroll, segmentnumrering, omsändning,
ordning av segment. (TCP-protokollet. Ej UDPprotokollet.)
Figure 2.14
Example 3
Example 3
Figur 2.14 exemplifierar transportlagret (UDPprotokollet). Data som kommer från högre lager förses
med en TCP-header, som innehåller portnummer j och k.
Avsändarprocessens portnummer är j och
mottagarprocessens portnummer är k. Eftersom
meddelandets storlek är större än nätverkslagret kan
hantera, delas datat i två segment (två paket).
Nätverkslagret lägger till nätverksadresserna (A och P)
till varje paket.
Lager 5:
Applikationslagret är kommunikationsprotokoll för
att tillhandahålla en komplett
kommunikationstjänst till slutanvändaren.
Exempel:
•HTTP för web
•FTP för filöverföring.
•SMTP och POP3 för Internet e-post
Figure 2.16
Summary of duties
Figure 12.1 Addressing techniques
Adresser till min dator





Fysisk MAC-adress, 48 bitar: 00-00-E2-4F-54-04
IP-adress, 32 bitar: 193.10.250.187.
Intern NAT-IP-adress (Network Address Translation): 10.14.1.63.
IP-subnetmask: 255.255.0.0
DNS-namn (Domain namn Service): mageripc.itm.miun.se, där
itm.miun.se är DNS-suffix, och .se är toppdomän.
 URL till webbsida på webbserver på min dator:
http://mageripc.itm.miun.se:portnummer/filkatalog/filnamn.typ
 URL till ftp-fil på min dator:
ftp://användanamn:lö[email protected]/filkatalog/filnamn.typ
 Filnamn till fil vid delad diskaccess till min dator:
\\mageripc.itm.miun.se\filkatalog\filnamn.typ (Av säkerhetsskäl inte
tillgänglig utanför nätet.)
 E-postadress till användare på en e-postserver på min dator:
anvä[email protected]
System och protokoll för översättning mellan
olika adresseringstekniker
 ARP (Address resolution protocol) översätter IP-adress till fysisk adress.
 DHCP (Dynamic Host Configuration Protocol) kan ge varje dator en
ledig IP-adress, och talar om för en dator med en viss fysisk adress vilken
dess IP-adress är vid varje omstart.
 DNS (Domain Name Server) är ett system av databaser som översätter
mellan IP-adress och DNS-adress.
 NAT (Network Address Translation) är en server, ofta i anslutning till
företagets brandvägg, som modifierar IP-paketen genom att byta ut
intern avsändar-IP-adress och portnummer till extern IP-adress +
portnummer vid utgående paket, och vice versa vid inkommande. På så
sätt kan många dela på samma externa IP-adress.
Network Interface Card (NIC)
 Each device on Ethernet network has its
own interface card (NIC) to connect to
the network
 The NIC is usually plugged into the
device and has a 6 bytes (48 bits) physical
address
 The physical address is normally written
in hexadecimal notation
 02-11-02-2C-4D-1B (example address)
NIC for a desktop
NIC for a laptop
Ethernet Addressing
 Each station recognizes three classes of addresses.
 Unicast address (for one-to-one communication)
 Broadcast address (for one-to-all communication)
 Optionally, one or more multicast addresses (for one-to-many
communication, i.e. to a group of users)
 Major reason for broadcast is address discovery. Brodcast Ethernet
address is all 1s, or in hexadecimal
 FF : FF : FF : FF : FF :FF
 Multicast addresses are used for specialized link layer functions.
 Ethernet addresses are unique
 First three bytes assigned to manufacturer by IEEE, the other three bytes
assigned by the manufacturer
IP-adresser
 32-bit adress i dagens IP version 4. 64-bit i IPversion 6.
 Exempelvis har Utbildningsradions www-server IP-adressen
1010 0001 0000 1010 0101 1011 0001 1111 binärt.
 På punkterad decimalform blir det 193.12.91.31.
 Hexadecimalt blir det C10C5B1F.
1010 0001 0000 1010
C
1
193
0
.
0101 1011 0001 1111
C
12
5
.
D
91
F
1
.
31
Figure 19.9
Dotted-decimal notation
Example 1
Change the following IP addresses from binary notation to dotteddecimal notation.
a.
10000001 00001011 00001011 11101111
b.
11111001 10011011 11111011 00001111
Solution
We replace each group of 8 bits with its equivalent decimal
number (see Appendix B) and add dots for separation:
a.
129.11.11.239
b.
249.155.251.15
Example 2
Change the following IP addresses from dotted-decimal notation to
binary notation.
a.
111.56.45.78
b.
75.45.34.78
Solution
We replace each decimal number with its binary equivalent
(see Appendix B):
a.
b.
01101111 00111000 00101101 01001110
01001011 00101101 00100010 01001110
IP-adressklasser
 Prefix = Net-ID. Anger nät, t.ex. för ett nät som kontrolleras
av en Internet-operatör eller ett företag. Fungerar som
riktnummer
 Suffix = Host-ID. Anger dator
 Basadress = Första IP-adressen i nätet, dvs med Net-ID=0
 Multicasting = En-till-många, dvs gruppkommunikation
 Broadcasting = En till alla.
 Förr användes klass A- B och C-adresser, där de första 8, 16
respektive 24 bitarna är Net-ID, och återstående bitar är
Host-ID. De första 1-4 bitarna anger klass.
Figure 9.5 IP address formats and classes
Figure 19.13
Netid and hostid
Figure 19.10
Finding the class in binary notation
Example 3
Find the class of each address:
a.
00000001 00001011 00001011 11101111
b.
11110011 10011011 11111011 00001111
Solution
See the procedure in Figure 19.11.
a.
b.
The first bit is 0; this is a class A address.
The first 4 bits are 1s; this is a class E address.
Figure 19.12
Finding the class in decimal notation
Figure 9.6 Subnet addressing: (a) address structure;
(b) example.
Klasslösa adresser
 Idag används klasslösa adresser med hjälp av IP-masker. En
1:a i IP-masken betyder att motsvarande bit i adressen
tillhör Net-ID.
 Exempel: IP-masken 255.255.0.0 = FFFF0000 (sexton 1:or
och sexton 0:or) betyder att de första 16 bitarna i IPadressen är Net-ID, övriga är Host-ID.
Note:
A network base address is different
from a netid. A network base address
has both netid and hostid,
with 0s for the hostid.
Figure 19.21 Addresses in a network with and without subnetting
Figure 19.22
Hierarchy concept in a telephone number
Table 19.1 Default masks
Class
In Binary
In Dotted-Decimal
Using Slash
A
11111111 00000000 00000000 00000000
255.0.0.0
/8
B
11111111 11111111 00000000 00000000
255.255.0.0
/16
C
11111111 111111111 11111111 00000000
255.255.255.0
/24
Note:
The network address can be found
by applying the default mask to any
address in the block (including itself).
It retains the netid of the block and
sets the hostid to 0s.
Example 8
A router outside the organization receives a packet with destination
address 190.240.7.91. Show how it finds the network address to
route the packet.
Solution
The router follows three steps:
1. The router looks at the first byte of the address to find the
class. It is class B.
2. The default mask for class B is 255.255.0.0. The router ANDs
this mask with the address to get 190.240.0.0.
3. The router looks in its routing table to find out how to route the
packet to this destination. Later, we will see what happens if
this destination does not exist.
Figure 19.23
Subnet mask
Example 9
A router inside the organization receives the same packet with
destination address 190.240.33.91. Show how it finds the
subnetwork address to route the packet.
Solution
The router follows three steps:
1. The router must know the mask. We assume it is /19, as shown in
Figure 19.23.
2. The router applies the mask to the address, 190.240.33.91. The subnet
address is 190.240.32.0.
3. The router looks in its routing table to find how to route the packet to
this destination. Later, we will see what happens if this destination does
not exist.
Figure 9.23 Multicasting over a LAN: (a) address
allocation principle;
Figure 9.31 IPv6 addresses: (a) prefix formats and
their use;
Figure 9.31 IPv6 addresses: (b) IPv4 address types;
ICMP (Internet Control Message Protocol)
Fel inträffar
Skickar felmeddelande, diagnostik tillbaks.
Sändningen lyckas
Skickar paket
Används för överföring av information om tillgänglighet och kommunikationsproblem.
Ping-programmet använder ICMP för att kontrollera om en extern dator är påslagen och
går att nå från Internet. ICMP används också för att meddela när att ett system inte går
att hitta.
Ping 211.181.211.30
Dator
Svar, TTL, storlek, osv.
Dator 211.181.211.30
Figure 14.3 Some examples of DNS zones.
Figure 14.4 Example showing the sequence of
messages exchanged for a local name resolution.
Table 19.2 Default masks
Range
Total
10.0.0.0
to
10.255.255.255
224
172.16.0.0
to
172.31.255.255
220
192.168.0.0
to
192.168.255.255
216
Figure 19.25
NAT
Figure 19.26 Address translation
Figure 19.27 Translation
Table 19.3 Five-column translation table
Private
Address
Private
Port
External
Address
External
Port
Transport
Protocol
172.18.3.1
1400
25.8.3.2
80
TCP
172.18.3.2
1401
25.8.3.2
80
TCP
...
...
...
...
...
Figure 20.2 ARP operation
Figure 20.5
Four cases using ARP
Note:
An ARP request is broadcast; an ARP
reply is unicast.
Example 1
A host with IP address 130.23.3.20 and physical address
B23455102210 has a packet to send to another host with IP address
130.23.43.25 and physical address A46EF45983AB. The two hosts
are on the same Ethernet network. Show the ARP request and reply
packets encapsulated in Ethernet frames.
Solution
Figure 20.6 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. Note that we use hexadecimal for every
field except the IP addresses.
Figure 20.6
Example 1
Figure 20.15
IPv6 address
Figure 20.23 Tunneling
Figure 20.24
Header translation