multimedie- och kommunikationssystem, lektion 8

57
Multimedie- och kommunikationssystem, lektion 8 Repetition av TCP/IP-modellens 5 nivåer Adressering på Internet: MAC-adresser, IP-adresser, subnet- masker, NAT, DNS-namn, portnummer, URL:er.

Upload: colleen-lopez

Post on 02-Jan-2016

32 views

Category:

Documents


4 download

DESCRIPTION

Multimedie- och kommunikationssystem, lektion 8. Repetition av TCP/IP-modellens 5 nivåer Adressering på Internet: MAC-adresser, IP-adresser, subnet-masker, NAT, DNS-namn, portnummer, URL:er. Figure 2.2 Internet layers. TCP, UDP. IP. Ethernet. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Multimedie- och kommunikationssystem, lektion 8

Multimedie- och kommunikationssystem, lektion 8

Repetition av TCP/IP-modellens 5 nivåerAdressering på Internet:

MAC-adresser, IP-adresser, subnet-masker, NAT, DNS-namn, portnummer, URL:er.

Page 2: Multimedie- och kommunikationssystem, lektion 8

Figure 2.2 Internet layers

TCP, UDP

Ethernet

IP

Page 3: Multimedie- och kommunikationssystem, lektion 8

Figure 2.4 An exchange using the Internet model

Page 4: Multimedie- och kommunikationssystem, lektion 8

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

Exempel: RS232.

Lager 1Lager 1

Page 5: Multimedie- och kommunikationssystem, lektion 8

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.

Lager 2Lager 2

Page 6: Multimedie- och kommunikationssystem, lektion 8

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.

Page 7: Multimedie- och kommunikationssystem, lektion 8

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 WAN-adressering (t.ex. IP-adresser) och routingprotokoll.

Exempel: IP-protokollet.

Lager 3Lager 3

Page 8: Multimedie- och kommunikationssystem, lektion 8

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 IP-adressen vilken väg paketen ska vidareförmedlas, och ändrar paketets fysiska adressering.

Page 9: Multimedie- och kommunikationssystem, lektion 8

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 UDP-protokollet.)

Lager 4Lager 4

Page 10: Multimedie- och kommunikationssystem, lektion 8

Figure 2.14 Example 3

Page 11: Multimedie- och kommunikationssystem, lektion 8

Example 3Example 3

Figur 2.14 exemplifierar transportlagret (UDP-protokollet). 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.

Page 12: Multimedie- och kommunikationssystem, lektion 8

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

Lager 5:Lager 5:

Page 13: Multimedie- och kommunikationssystem, lektion 8

Figure 2.16 Summary of duties

Page 14: Multimedie- och kommunikationssystem, lektion 8

Figure 12.1 Addressing techniques

Page 15: Multimedie- och kommunikationssystem, lektion 8

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]

Page 16: Multimedie- och kommunikationssystem, lektion 8

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.

Page 17: Multimedie- och kommunikationssystem, lektion 8

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

Page 18: Multimedie- och kommunikationssystem, lektion 8

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

Page 19: Multimedie- och kommunikationssystem, lektion 8

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.

FC 1 0 C 5 D 1

31193 12 91

1010 0001 0000 1010 0101 1011 0001 1111

. . .

Page 20: Multimedie- och kommunikationssystem, lektion 8

Figure 19.9 Dotted-decimal notation

Page 21: Multimedie- och kommunikationssystem, lektion 8

Example 1Example 1

Change the following IP addresses from binary notation to dotted-decimal notation.

a. 10000001 00001011 00001011 11101111

b. 11111001 10011011 11111011 00001111

SolutionSolution

We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add dots for separation:a. 129.11.11.239b. 249.155.251.15

Page 22: Multimedie- och kommunikationssystem, lektion 8

Example 2Example 2

Change the following IP addresses from dotted-decimal notation to binary notation.

a. 111.56.45.78

b. 75.45.34.78

SolutionSolution

We replace each decimal number with its binary equivalent (see Appendix B):

a. 01101111 00111000 00101101 01001110b. 01001011 00101101 00100010 01001110

Page 23: Multimedie- och kommunikationssystem, lektion 8

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.

Page 24: Multimedie- och kommunikationssystem, lektion 8

Figure 9.5 IP address formats and classes

Page 25: Multimedie- och kommunikationssystem, lektion 8

Figure 19.13 Netid and hostid

Page 26: Multimedie- och kommunikationssystem, lektion 8

Figure 19.10 Finding the class in binary notation

Page 27: Multimedie- och kommunikationssystem, lektion 8

Example 3Example 3

Find the class of each address:

a. 000000001 00001011 00001011 11101111

b. 111111110011 10011011 11111011 00001111

SolutionSolution

See the procedure in Figure 19.11.

a. The first bit is 0; this is a class A address.b. The first 4 bits are 1s; this is a class E address.

Page 28: Multimedie- och kommunikationssystem, lektion 8

Figure 19.12 Finding the class in decimal notation

Page 29: Multimedie- och kommunikationssystem, lektion 8

Figure 9.6 Subnet addressing: (a) address structure;(b) example.

Page 30: Multimedie- och kommunikationssystem, lektion 8

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 IP-adressen är Net-ID, övriga är Host-ID.

Page 31: Multimedie- och kommunikationssystem, lektion 8

A network base address is different from a netid. A network base address

has both netid and hostid, with 0s for the hostid.

NoteNote::

Page 32: Multimedie- och kommunikationssystem, lektion 8

Figure 19.21 Addresses in a network with and without subnetting

Page 33: Multimedie- och kommunikationssystem, lektion 8

Figure 19.22 Hierarchy concept in a telephone number

Page 34: Multimedie- och kommunikationssystem, lektion 8

Table 19.1 Default masksTable 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

Page 35: Multimedie- och kommunikationssystem, lektion 8

The network address can be foundby 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.

NoteNote::

Page 36: Multimedie- och kommunikationssystem, lektion 8

Example 8Example 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.

SolutionSolution

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.

Page 37: Multimedie- och kommunikationssystem, lektion 8

Figure 19.23 Subnet mask

Page 38: Multimedie- och kommunikationssystem, lektion 8

Example 9Example 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.

SolutionSolution

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.

Page 39: Multimedie- och kommunikationssystem, lektion 8

Figure 9.23 Multicasting over a LAN: (a) address allocation principle;

Page 40: Multimedie- och kommunikationssystem, lektion 8

Figure 9.31 IPv6 addresses: (a) prefix formats and their use;

Page 41: Multimedie- och kommunikationssystem, lektion 8

Figure 9.31 IPv6 addresses: (b) IPv4 address types;

Page 42: Multimedie- och kommunikationssystem, lektion 8

ICMP (Internet Control Message Protocol)

Sändningen lyckas

Fel inträffar

Skickar felmeddelande, diagnostik tillbaks.

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.

Dator 211.181.211.30

Ping 211.181.211.30

Svar, TTL, storlek, osv.Dator

Page 43: Multimedie- och kommunikationssystem, lektion 8

Figure 14.3 Some examples of DNS zones.

Page 44: Multimedie- och kommunikationssystem, lektion 8

Figure 14.4 Example showing the sequence of messages exchanged for a local name resolution.

Page 45: Multimedie- och kommunikationssystem, lektion 8

Table 19.2 Default masksTable 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

Page 46: Multimedie- och kommunikationssystem, lektion 8

Figure 19.25 NAT

Page 47: Multimedie- och kommunikationssystem, lektion 8

Figure 19.26 Address translation

Page 48: Multimedie- och kommunikationssystem, lektion 8

Figure 19.27 Translation

Page 49: Multimedie- och kommunikationssystem, lektion 8

Table 19.3 Five-column translation tableTable 19.3 Five-column translation table

Private Address

Private Port

ExternalAddress

External Port

TransportProtocol

172.18.3.1 1400 25.8.3.2 80 TCP

172.18.3.2 1401 25.8.3.2 80 TCP

... ... ... ... ...

Page 50: Multimedie- och kommunikationssystem, lektion 8

Figure 20.2 ARP operation

Page 51: Multimedie- och kommunikationssystem, lektion 8

Figure 20.5 Four cases using ARP

Page 52: Multimedie- och kommunikationssystem, lektion 8

An ARP request is broadcast; an ARP reply is unicast.

NoteNote::

Page 53: Multimedie- och kommunikationssystem, lektion 8

Example 1Example 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.

SolutionSolution

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.

Page 54: Multimedie- och kommunikationssystem, lektion 8

Figure 20.6 Example 1

Page 55: Multimedie- och kommunikationssystem, lektion 8

Figure 20.15 IPv6 address

Page 56: Multimedie- och kommunikationssystem, lektion 8

Figure 20.23 Tunneling

Page 57: Multimedie- och kommunikationssystem, lektion 8

Figure 20.24 Header translation