468
Вовед Мрежни протоколи 1 Предавање 1 Вовед 

Preda Vanja

  • Upload
    -

  • View
    67

  • Download
    0

Embed Size (px)

DESCRIPTION

информатика

Citation preview

  • 5/27/2018 Preda Vanja

    1/467

    1

    1

  • 5/27/2018 Preda Vanja

    2/467

    2

    ?

  • 5/27/2018 Preda Vanja

    3/467

    ?

    3

  • 5/27/2018 Preda Vanja

    4/467

    4

  • 5/27/2018 Preda Vanja

    5/467

    ( )

    (, ,

    , , ...)

    ( )

    ,

    ( )

    , ,

    5

  • 5/27/2018 Preda Vanja

    6/467

    , , Skype, Messinger

    ,

    ,

    6

  • 5/27/2018 Preda Vanja

    7/467

    (LAN)

    Ethernet

    ( )

    7

  • 5/27/2018 Preda Vanja

    8/467

    ( )

    ( )

    (

    )

    ?

    8

  • 5/27/2018 Preda Vanja

    9/467

    9

  • 5/27/2018 Preda Vanja

    10/467

    ( )

    10

  • 5/27/2018 Preda Vanja

    11/467

    11

  • 5/27/2018 Preda Vanja

    12/467

    12

    M

    ? .

    , () .

  • 5/27/2018 Preda Vanja

    13/467

    (

    )

    ,

    13

  • 5/27/2018 Preda Vanja

    14/467

    14

  • 5/27/2018 Preda Vanja

    15/467

    15

  • 5/27/2018 Preda Vanja

    16/467

    :

    , ,

    .

    ,

    16

  • 5/27/2018 Preda Vanja

    17/467

    ?

    ?

    ,

    (CRC, Sumcheck) 17

  • 5/27/2018 Preda Vanja

    18/467

    ( )

    *

    ...)

    (

    ...) 18

  • 5/27/2018 Preda Vanja

    19/467

    19

    ?

    , .

    --

  • 5/27/2018 Preda Vanja

    20/467

    --

    ,

    ?

    ?

    20

  • 5/27/2018 Preda Vanja

    21/467

    De facto ( RFC)

    De jure ( ISO)

    21

  • 5/27/2018 Preda Vanja

    22/467

    22

  • 5/27/2018 Preda Vanja

    23/467

    23

    Step 1:

    Step 2:

    Step 3:

    ::::::::::

    1:

    2:

    3:

    ::::::::::

    1:

    2:

    3:

    ::::::::::

    ( )

  • 5/27/2018 Preda Vanja

    24/467

    ?

    ,

    24

  • 5/27/2018 Preda Vanja

    25/467

    25

    (padding)

    .

  • 5/27/2018 Preda Vanja

    26/467

    (, ,

    , ,

    )

    LAN

    (, ,

    ).

    26

  • 5/27/2018 Preda Vanja

    27/467

    ,

    ,

    Token-ring FDDI

    27

  • 5/27/2018 Preda Vanja

    28/467

    28

    --

    Frame relay

  • 5/27/2018 Preda Vanja

    29/467

    29

  • 5/27/2018 Preda Vanja

    30/467

    (.)

    B ursty ()

    symmetric ()

    D elicate ()

    30

  • 5/27/2018 Preda Vanja

    31/467

    (.)

    31

  • 5/27/2018 Preda Vanja

    32/467

    (

    ) (

    )

    32

  • 5/27/2018 Preda Vanja

    33/467

    ()

    ()

    33

  • 5/27/2018 Preda Vanja

    34/467

    34

    1

    2

    3

    (router)

  • 5/27/2018 Preda Vanja

    35/467

    35

    Buffering (queues)

  • 5/27/2018 Preda Vanja

    36/467

    :

    36

    A

    B

  • 5/27/2018 Preda Vanja

    37/467

    37

    :

    4

    = 9600 bps

    = 5000bits

    , Tp= 1 ms

    Tcs= 1 s

    = 1024 bits

    .= 24 bits

    ,

    = + +

    Tc = 1 + 5000/9600 + 4 0.001 = 1.53 s

    = 5000/(1024 24) = 5

    = +

    + Tp = 5 (1024/9600) + (4 1)(1024/9600) + 4

    0.01 = 0.857

  • 5/27/2018 Preda Vanja

    38/467

    1

    2

  • 5/27/2018 Preda Vanja

    39/467

    2

    ISO OSI TCP/IP

    (NIC)

    (hub) (switch)

    (router)

  • 5/27/2018 Preda Vanja

    40/467

    3

  • 5/27/2018 Preda Vanja

    41/467

    ?

    ( )?

    ()

    TCP/IP

    ( )?

    () ()

    ?

    ? ? 4

  • 5/27/2018 Preda Vanja

    42/467

    5

    (router) (workstation)

    (server) (mobile)

  • 5/27/2018 Preda Vanja

    43/467

    (,

    , , , ....)

    ()

    ()

    ( )

    ( )

    6

  • 5/27/2018 Preda Vanja

    44/467

    7

    1:

    2:

    3:

    ::::::::::

    1:

    2:

    3:::::::::::

    1:2:

    3:

    ::::::::::

  • 5/27/2018 Preda Vanja

    45/467

    1969

    ARPANET (Advanced Research Project Agency

    Network)

    ,

    1970

    ,

    *

    ) 8

  • 5/27/2018 Preda Vanja

    46/467

    (.)

    1984 TCP/IP

    ,

    ,

    19891993

    1995

    9

  • 5/27/2018 Preda Vanja

    47/467

    ( )

    ?

    , ,

    10

  • 5/27/2018 Preda Vanja

    48/467

    IABInternet rchitecture Board

    IETFInternet Engineering Task Force

    IRTF- Internet Research Task Force ISOCInternet society

    IANAInternet Asigned Number Authority

    ICANNInternet Corporation for AssignedNames and Numbers

    IGFInternet Governence Forum

    11

  • 5/27/2018 Preda Vanja

    49/467

    Internet Service Providers (ISP)

    naInternet

    POP (Point-of-

    presence) ISP

    12

    NAP (Network Access Point) O (router switch)

    ISP

    )

  • 5/27/2018 Preda Vanja

    50/467

    1987 .

    NAP

    13

  • 5/27/2018 Preda Vanja

    51/467

    ,

    RFC (Request For Comments)

    FYI (For Your Informaion)

    RFC

    14

  • 5/27/2018 Preda Vanja

    52/467

    ?

    Best effort

    (QoS, Quality of Service)

    15

  • 5/27/2018 Preda Vanja

    53/467

    16

  • 5/27/2018 Preda Vanja

    54/467

    .... 17

  • 5/27/2018 Preda Vanja

    55/467

    18

  • 5/27/2018 Preda Vanja

    56/467

    19

  • 5/27/2018 Preda Vanja

    57/467

    SNA (System

    Network Architecture) IBM, DecNet Digital

    OSI (Open System Interconnection) TCP/IP

    20

  • 5/27/2018 Preda Vanja

    58/467

    OSI

    TCP/IP

    TCP/IP

    TCP/IP

    21

  • 5/27/2018 Preda Vanja

    59/467

    SI

    22

    Application

    Presentation

    Session

    Transport

    Network

    Data Link

    Physical

    Network

    Data Link

    Physical

    Intermediate System

    End

    System

    Application

    Presentation

    Session

    Transport

    Network

    Data Link

    Physical

    R

  • 5/27/2018 Preda Vanja

    60/467

    SI

    23

    Application

    Presentation

    Session

    Transport

    Network

    Data Link

    Physical

    (FTP, WWW,

    , e-, ....).

    ,

    .

    (,

    )

    ,

    ,

    .

    ,

  • 5/27/2018 Preda Vanja

    61/467

    peer-to-peer

    peer-to-peer

    24

  • 5/27/2018 Preda Vanja

    62/467

    25

  • 5/27/2018 Preda Vanja

    63/467

    26

    5

    4

    3

    2

    BITS

    H2 DATA UNIT T2

    DATA UNIT

    H4 DATA UNIT

    H5 DATA

    H3

    DATA

    5

    4

    3

    2

  • 5/27/2018 Preda Vanja

    64/467

    27

    frame

    packet

  • 5/27/2018 Preda Vanja

    65/467

    TCP/IP

    de facto

    OSI

    28

  • 5/27/2018 Preda Vanja

    66/467

    TCP/IP OSI

    29

    Transport

    Network

    Application

    Physical

    SMTP FTP

    TELNET DNS

    HTTPApplication

    Presentation

    Session

    TransportTCP UDP

    NetworkIGMPICMP

    IP

    DHCPARP

    Data Link

    Physical

    Protocols defined by the

    underlying networks

  • 5/27/2018 Preda Vanja

    67/467

    30

  • 5/27/2018 Preda Vanja

    68/467

    (Repeater)

    (Hub)

    (MAC )

    (Bridge) (Switch)

    31

    (Router)

    Gateway

  • 5/27/2018 Preda Vanja

    69/467

    (NIC)

    ()

    6 (48

    )

    (11-2-34-0-23-47)

    32

  • 5/27/2018 Preda Vanja

    70/467

    33

  • 5/27/2018 Preda Vanja

    71/467

    ,

    34

  • 5/27/2018 Preda Vanja

    72/467

    (Bridge)

    35

    Bridge

    A B C D E F

  • 5/27/2018 Preda Vanja

    73/467

    (Switch)

    36

    Switch

  • 5/27/2018 Preda Vanja

    74/467

    ( )

    ?

    37

  • 5/27/2018 Preda Vanja

    75/467

    Spanning tree protocol 38

    B1

    B2

    1

    1

    3

    2

    2 3 4

    4

    B1

    B2

    Network abstracted into a graph

    Each LAN and each bridge represent

    a node in the graph

  • 5/27/2018 Preda Vanja

    76/467

    Cut-through

    store-and-forward

    store-and-forward

    cut-

    through

    39

  • 5/27/2018 Preda Vanja

    77/467

    (router)

    ( plug-and-play)

    40

  • 5/27/2018 Preda Vanja

    78/467

    41

    hubs Bridges Routers Ethernetswitches

    Traffic isolation no yes yes yes

    Plug-and-play yes yes no yes

    Optimal routing no no yes no

    Cut-through yes no no yes

    DevicesProperties

    ( )

  • 5/27/2018 Preda Vanja

    79/467

    (e )

    : (bridges)

    (switches) .

    .

    IP .

    42

    ?

  • 5/27/2018 Preda Vanja

    80/467

    ?

    3000

    1000 Hz.

    ( )

    .

    43

  • 5/27/2018 Preda Vanja

    81/467

    1

    3

  • 5/27/2018 Preda Vanja

    82/467

    IP

    , ,

    VLSM

    CIDR

    2

  • 5/27/2018 Preda Vanja

    83/467

    (? ?)

    ()

    ( ?) 3

  • 5/27/2018 Preda Vanja

    84/467

    (interface)

    IPv4

    4 (32 )

    4

    1000111110000000 1000100110010000

    1st

    Byte

    = 128

    2nd

    Byte

    = 143

    3rd

    Byte

    = 137

    4th

    Byte

    = 144

    128.143.137.144

  • 5/27/2018 Preda Vanja

    85/467

    IP ?

    IP

    5

  • 5/27/2018 Preda Vanja

    86/467

    6

    R1

    R3

    R2

    H1

    H5H4

    H2 H3 H7H6

    Network1 (Ethernet) Network3 (Ethernet)

    Network2(FDDI)

    Network4 (point-to-point)

    ( )

  • 5/27/2018 Preda Vanja

    87/467

    (.)

    7

    Application layer protocol

    Transport layer protocol

    IP

    protocol

    Ethernet

    protocol

    App.

    Transp.

    Network

    Eth.

    IP

    protocol

    FDDI

    protocol

    IP

    Eth. FDDI

    IP

    FDDI PPP

    IP

    PPP Eth.

    IP

    protocol

    App.

    Transp.

    Network

    Eth.

    PPP

    protocolEthernet

    protocol

    IP

    protocol

    H1 H6

    R1 R2 R3

    Network1(Ethernet)Network2(FDDI) Network4(point-to-point)

    Network3 (Ethernet

    IP

  • 5/27/2018 Preda Vanja

    88/467

    8

    IP

    32

    232= 4.292.967.296

    IP

    IP

    ()

    IP

  • 5/27/2018 Preda Vanja

    89/467

    9

    2 23 34 4

    5 56 27 38 3

    1

  • 5/27/2018 Preda Vanja

    90/467

    ()

    10

    1.1

    3.1

    1.21.3

    2.1

    3

    2

    3.2

    2.2

    3.3

    1Destination Next hop

    1.2 1.21.3 1.32.* 2.13.* 3.1

    1.1

    Destination Next hop* 1.1

    1.2

    IP

  • 5/27/2018 Preda Vanja

    91/467

    IP

    IP

    ( , ,

    )

    ( , , )

    ( )

    11

    Network ID Host ID

    0 31

    IP

  • 5/27/2018 Preda Vanja

    92/467

    IP

    IP

    Multihomed host (

    )

    ( ),

    12

    IP

  • 5/27/2018 Preda Vanja

    93/467

    IP

    IANA (Internet Assigned Number Authority) ICANN (The Internet Coorporation for Assigned Names and Numbers)

    RIPE -

    ARIN

    13

  • 5/27/2018 Preda Vanja

    94/467

    ( )

    32 ,

    14

  • 5/27/2018 Preda Vanja

    95/467

    15

    IP 193.5.1.5 255.255.255.0

    255.255.255.0

    24 8 .

    24

    193.5.1.5/24

    Network ID = 193.5.1 Host ID = 5

    0 3124

  • 5/27/2018 Preda Vanja

    96/467

    ( 1980.)

    5

    ( 8 , 255.0.0.0)

    ( 16 , 255.255.0.0)

    ( 24 ,

    255.255.255.0)

    , D ( )

    ( )

    16

  • 5/27/2018 Preda Vanja

    97/467

    1980

    ( )

    ,

    ,

    17

  • 5/27/2018 Preda Vanja

    98/467

    ,

    :IP 0

    B:IP 10 C:IP 110

    D: IP 1110

    E:IP 11110

    18

  • 5/27/2018 Preda Vanja

    99/467

    19

    Net ID Host ID

    C

    D

    E 0

    0

    0

    0 1 2 3 4 8 16 24 31

    Net ID Host IDA 0

    Net ID Host IDB 01

    1 1

    1 1 1

    1 1 1 1

  • 5/27/2018 Preda Vanja

    100/467

    ,

    (193.4.5.0)

    ,

    (0.0.0.3)

    , (193.4.5.255)

    ,

    20

  • 5/27/2018 Preda Vanja

    101/467

    (loopback)

    127.0.0.0127.255.255.255 ( )

    127.0.0.1

    255.255.255.255

    21

  • 5/27/2018 Preda Vanja

    102/467

    22

    0

    0 hostId

    1netId

    127

    1

    0

    0 netId

  • 5/27/2018 Preda Vanja

    103/467

    23

    192.16.5.0 192.16.5.3

    192.16.5.2192.16.5.1

    192.16.4.3

    192.16.4.2192.16.4.1

    192.16.4.0

    192.16.3.0

    192.16.3.3192.16.3.2192.16.3.1 192.16.3.4 192.16.3.5

    192.16.4.255

    192.16.3.255

    IP

  • 5/27/2018 Preda Vanja

    104/467

    24

    IP

    RFC 1918

    (

    ()

    10.0.0.0. - 10.255.255.255 ( A )

    172.16.0.0172.31.255.255 (16 B )

    192.168.0.0192.168.255.255 (256 C )

    A

  • 5/27/2018 Preda Vanja

    105/467

    25

    A: 0 7-

    127 (0111111)

    ( )

    : 272 = 126 ,

    125

    : 2242 =

    16.777.214 0 1

    B C

  • 5/27/2018 Preda Vanja

    106/467

    26

    B C

    B: , 10 128-191

    : 214 = 16.384 21416 =16.368

    : 2162 = 65.534

    C: , 110 192-223

    : 221= 2.097.152 or 221256 =2.096.896

    :282= 254

  • 5/27/2018 Preda Vanja

    107/467

    27

    1980- 1990-

    ( )

    1990- ( )

  • 5/27/2018 Preda Vanja

    108/467

    28

    C

    B

    ,

    ( )

  • 5/27/2018 Preda Vanja

    109/467

    29

  • 5/27/2018 Preda Vanja

    110/467

    30

    IP IP 5

    IP 6

    (DHCP, NAT)

  • 5/27/2018 Preda Vanja

    111/467

    31

    ISP

    B

    2

    1

    ?

  • 5/27/2018 Preda Vanja

    112/467

    32

    ?

    , ,

    C

    B

  • 5/27/2018 Preda Vanja

    113/467

    33

    B 01

    B 01

    B:

    B :

    Network ID

    Network ID Host ID

    Host ID

    Subnet ID

  • 5/27/2018 Preda Vanja

    114/467

    34

    C 11

    C 11

    C:

    :

    Network prefix

    Extended Network Prefix

    Host

    suffix

    Host suffix

    Subnet

    0

    0

    Network prefix

  • 5/27/2018 Preda Vanja

    115/467

    35

    ()

  • 5/27/2018 Preda Vanja

    116/467

    36

    R1

    R2

    130.194.1.0

    130.194.2.0

    130.194.1.5

    130.194.2.5

    Global

    Internet

    All traffic to130.194.0.0

    I have only130.194.0.0

  • 5/27/2018 Preda Vanja

    117/467

    37

    (N)

    (b), N = 2b

    n,

    216-b

    -2 ako 28-b-2

    ( )

  • 5/27/2018 Preda Vanja

    118/467

    (.)

    16+b

    24+b

    ,

    38

  • 5/27/2018 Preda Vanja

    119/467

    5 B, 138.10.0.0

    3 23= 8 < 5

    , 16-3 = 13.

    2132

    = 8190 .

    39

    138 10 0 0

  • 5/27/2018 Preda Vanja

    120/467

    40

    Subnet ID First host Last host Broadcast address

    32.0 32.1 63.254 63.255

    64.0 64.1 95.254 95.255

    96.0 96.1 127.254 127.255

    128.0 128.1 159.254 159.255

    160.0 160.1 191.254 191.255

    192.0 192.1 223.254 223.255

    138.10.0.0

    Subnet 0.0 and 224.0 are avoided. The mask for all subnets is 255.255.224.0

  • 5/27/2018 Preda Vanja

    121/467

    41

    Subnet ID First host Last host Broadcast address

    0.64 0.65 0.126 0.127

    0.128 0.129 0.190 0.191

    0.192 0.193 0.254 0.255

    1.0 1.1 1.62 1.64

    255.128 255.129 255.190 255.191

    The subnet mask for all subnets is 255.255.255.192

    140.25.0.0 510

  • 5/27/2018 Preda Vanja

    122/467

    42

    VLSM (Variable LengthSubnet Mask)

    ?

  • 5/27/2018 Preda Vanja

    123/467

    , b ( )

    43

    VLSM

  • 5/27/2018 Preda Vanja

    124/467

    44

    0 255

  • 5/27/2018 Preda Vanja

    125/467

    45

    ()

    ,

  • 5/27/2018 Preda Vanja

    126/467

    46

    Class C24-bit prefix

    11000000192 168 64 0/24

    10101000 01000000

    Class C next24-bit prefix

    11000000

    192 168 65 0/24

    10101000 01000001 00000000

    Prefix Host part

    00000000

    Commonprefix: 23 bits 11111111 11111111 11111110 000000000 00000000

    00000000

    Classless23-bit prefix 11000000

    192 168 64 0/23

    10101000 01000000 000000000 00000000

    201 10 0 0

    8

  • 5/27/2018 Preda Vanja

    127/467

    47

    1100 1001 . 0000 1010 . 0000 0000 . 0000 0000

    1100 1001 . 0000 1010 . 0000 0111 . 1111 1111201 10 7 255

    21 11

    2048

    addresses

    201.10.0.0 / 21 =

    201.10.0.0 201.10.0.255201.10.1.0 201.10.1.255201.10.2.0 201.10.2.255201.10.3.0 201.10.3.255201.10.4.0 201.10.4.255201.10.5.0 201.10.5.255201.10.6.0 201.10.6.255201.10.7.0 201.10.7.255

    256 addresses = 1 class C network

    EightClass CNetworks= 256 X 8

    = 2048addresses

  • 5/27/2018 Preda Vanja

    128/467

    48

    Multiregional 192.0.0.0 - 193.255.255.255Europe 194.0.0.0 - 195.255.255.255Others 196.0.0.0 - 197.255.255.255

    North America 198.0.0.0 - 199.255.255.255Central & South America 200.0.0.0 - 201.255.255.255Pacific Rim 202.0.0.0 - 203.255.255.255Reserved 204.0.0.0 - 207.255.255.255

    ICCAN

  • 5/27/2018 Preda Vanja

    129/467

    49

    ICCAN

  • 5/27/2018 Preda Vanja

    130/467

    50

    Classless Inter Domain RoutingCIDR(pronounced cider)

    ,

    ( )

    CIDR

  • 5/27/2018 Preda Vanja

    131/467

    51

    (ISP)

    ( )

    ()

  • 5/27/2018 Preda Vanja

    132/467

    52

    ,

    , , .

    192.16.128.0/17192.16.0.0/18

    192.16.64.0/18

    192.16.0.0/16

    CIDR

  • 5/27/2018 Preda Vanja

    133/467

    53

    Internet Service Provider 1

    (198.0.0.0 - 198.255.255.0)

    NAP

    Internet ServiceProvider 2(198.32.0.0-

    198.32.255.0)

    Internet ServiceProvider 3

    (198.33.0.0 -198.33.255.0)

    Internet ServiceProvider 2

    (198.32.0.0/16)

    Internet ServiceProvider 3

    (198.33.0.0/16)

    198.32.1.0

    198.32.2.0

    198.32.3.0

    198.33.1.0

    198.33.1.0198.32.1.0198.32.2.0198.32.3.0

    198.32.1.0198.32.2.0198.32.3.0198.33.1.0

    Internet Service Provider 1(198.0.0.0/8)

    198.33.1.0198.32.3.0

    198.32.2.0

    198.32.1.0

    198.33.0.0/16198.32.0.0/16

    198.0.0.0/8

    198.32.1.0

  • 5/27/2018 Preda Vanja

    134/467

    54

    Prefix Mask Prefix Mask

    Decimal Binary

    128 1000 0000192 1100 0000224 1110 0000240 1111 0000248 1111 1000252 1111 1100

    254 1111 1110255 1111 1111

    /1 128.0.0.0/2 192.0.0.0/3 224.0.0.0/4 240.0.0.0/5 248.0.0.0/6 252.0.0.0

    /7 254.0.0.0/8 255.0.0.0/9 255.128.0.0/10 255.192.0.0/11 255.224.0.0/12 255.240.0.0

    /13 255.248.0.0/14 255.252.0.0/15 255.254.0.0/16 255.255.0.0

    /17 255.255.128.0/18 255.255.192.0/19 255.255.224.0/20 255.255.240.0/21 255.255.248.0/22 255.255.252.0

    /23 255.255.254.0/24 255.255.255.0/25 255.255.255.128/26 255.255.255.192/27 255.255.255.224/28 255.255.255.240

    /29 255.255.255.248/30 255.255.255.252/31 255.255.255.254/32 255.255.255.255

  • 5/27/2018 Preda Vanja

    135/467

    56

    ()

    B11

    B15

    B14

    B16

    B12

    B13

  • 5/27/2018 Preda Vanja

    136/467

    57

    :

    ? ?

    ( )

    ?

    ?

  • 5/27/2018 Preda Vanja

    137/467

    58

    20- , 172.16.0.0/20 . 400 , 10 100 , 12 45

    6 2 . -- . .

    ?2(32-20)= 212= 4096

  • 5/27/2018 Preda Vanja

    138/467

    59

    . 400 . 400 2 512. 512 9 29= 512. 20 ID na 3 (20+3+9=32). 400 .

    2 3 4 5 6 7 81

    -

    -

  • 5/27/2018 Preda Vanja

    139/467

    60

    .

    100 . 100 2 128 (27= 128).

    7 .

    512

    4 128 .

    25 (25+7=32). 512 12 128.

    10.

    2 3 4 5 6 7 81

  • 5/27/2018 Preda Vanja

    140/467

    61

    128

    .

    45 6 26=64.

    512 ,

    5

    .

  • 5/27/2018 Preda Vanja

    141/467

    62

    512

    8 64 .

    26 , 3

    .

    12 6

    5. ,

    5

    , 6. .

  • 5/27/2018 Preda Vanja

    142/467

    63

    WAN

    .

    30 . 26 ,

    16 .

    2 3 4 5 6 7 81 5

  • 5/27/2018 Preda Vanja

    143/467

    64

    Subnet Mask First host Last host

    172.16.2.0 255.255.254.0 172.16.2.1 172.16.3.254

    172.16.4.0 255.255.255.128 172.16.4.1 172.16.4.126

    172.16.4.128 255.255.255.128 172.16.4.129 172.16.4.254

    172.16.5.0 255.255.255.128 172.16.5.1 172.16.5.126

    172.16.5.128 255.255.255.128 172.16.5.129 172.16.5.254172.16.6.0 255.255.255.128 172.16.6.1 172.16.6.126

    172.16.6.128 255.255.255.128 172.16.6.129 172.16.6.254

    172.16.7.0 255.255.255.128 172.16.7.1 172.16.7.126

    172.16.7.128 255.255.255.128 172.16.7.129 172.16.7.254

    172.16.8.0 255.255.255.128 172.16.8.1 172.16.8.126

    172.16.8.128 255.255.255.128 172.16.8.129 172.16.8.254

    Subnet Mask First host Last host

  • 5/27/2018 Preda Vanja

    144/467

    65

    Subnet Mask First host Last host

    172.16.10.0 255.255.255.192 172.16.10.1 172.16.10.62

    172.16.10.64 255.255.255.192 172.16.10.65 172.16.10.126

    172.16.10.128 255.255.255.192 172.16.10.129 172.16.10.190

    172.16.10.192 255.255.255.192 172.16.10.193 172.16.10.252

    172.16.11.0 255.255.255.192 172.16.11.1 172.16.11.62

    172.16.11.64 255.255.255.192 172.16.11.65 172.16.11.126

    172.16.11.128 255.255.255.192 172.16.11.129 172.16.11.190

    172.16.11.192 255.255.255.192 172.16.11.193 172.16.11.252

    172.16.12.0 255.255.255.192 172.16.12.1 172.16.12.62

    172.16.12.64 255.255.255.192 172.16.12.65 172.16.12.126172.16.12.128 255.255.255.192 172.16.12.129 172.16.12.190

    172.16.12.191 255.255.255.192 172.16.12.193 172.16.12.254

  • 5/27/2018 Preda Vanja

    145/467

    66

    Subnet number Mask First host Last host

    172.16.14.0 255.255.255.254 172.16.14.1 172.16.14.2172.16.14.4 255.255.255.254 172.16.14.5 172.16.14.6

    172.16.14.8 255.255.255.254 172.16.14.9 172.16.14.10

    172.16.14.12 255.255.255.254 172.16.14.13 172.16.14.14

    172.16.14.16 255.255.255.254 172.16.14.17 172.16.11.18172.16.14.20 255.255.255.254 172.16.14.21 172.16.11.22

  • 5/27/2018 Preda Vanja

    146/467

    67

    202.12.28.0/25

    128 hosts

    202.12.28.128/26

    64 hosts

    202.12.28.192/26

    64 hosts

    202.12.28.128/25

    128 hosts

    202.12.28.0/24

    256 hosts

    202.12.29.0/24

    256 hosts

    202.12.28.0/23

    512 hosts

    202.12.30.0/24

    256 hosts

    202.12.31.0/25

    128 hosts

    202.12.31.128/25

    128 hosts

    202.12.31.0/24

    256 hosts

    202.12.28.30/23

    512 hosts

    202.12.28.0/22

    1024 hosts

    202.12.28.0/22. 7 , 2

    254 , 126 62 .

    .

  • 5/27/2018 Preda Vanja

    147/467

    IP, ICMP, IGMP 1

    4

    (IPv4),ICMP, IGMP

    4

  • 5/27/2018 Preda Vanja

    148/467

    IP, ICMP, IGMP 2

    4

    TTL (Time To Live)

    ICMP

    IGMP

  • 5/27/2018 Preda Vanja

    149/467

    4 (IPv4)

    IP, ICMP, IGMP 3

    IP

    (.)

  • 5/27/2018 Preda Vanja

    150/467

    IP, ICMP, IGMP 5

    ( )

    ( )

    Connectionless

    Best effort

    IP

  • 5/27/2018 Preda Vanja

    151/467

    IP

    IP connectionless data delivery

    UDP(User Datagram Protocol)

    (Transmission Control Protocol) connection-oriented data delivery

    IP, ICMP, IGMP 6

    IP ()

  • 5/27/2018 Preda Vanja

    152/467

    IP

    IP

    IP, ICMP, IGMP 7

    IP , 4

  • 5/27/2018 Preda Vanja

    153/467

    (4 )

    4 4

    (4 )

    32- 5(

    20 )

    15 (

    60 ) (8 )

    IP, ICMP, IGMP 8

    IP (.)

  • 5/27/2018 Preda Vanja

    154/467

    (16 )

    (16 )

    (3 )

    (13 )

    L (Time To Live) (8 )

    IP, ICMP, IGMP 9

    IP (.)

  • 5/27/2018 Preda Vanja

    155/467

    (8 )

    (1=ICMP, 2=IGMP, 6=TCP, 17=UDP)

    (16 ) IP (32 )

    IP (32 )

    IP, ICMP, IGMP 10

    IPv4

  • 5/27/2018 Preda Vanja

    156/467

    IP, ICMP, IGMP 11

    0 3115 16

    Source IP address

    length

    checksum

    Destination IP address

    version h -length type of service

    flagsIdentification Fragmentation offset

    time to live protocol

    options padding

  • 5/27/2018 Preda Vanja

    157/467

    IP

    IP, ICMP, IGMP 12

  • 5/27/2018 Preda Vanja

    158/467

    IP, ICMP, IGMP 13

  • 5/27/2018 Preda Vanja

    159/467

    IP, ICMP, IGMP 14

    Precedence Definition

    0 routine (normal)

    1 priority

    2 immediate

    3 flash

    4 flash override

    5 critical

    6 internetwork control

    7 network control

  • 5/27/2018 Preda Vanja

    160/467

    IP, ICMP, IGMP 15

    Value Service Description AP using the suggested value

    0 normal normal datagram ICMP error messages, DNS TCP

    1 minimize delay the packet must go through anet with a low latency

    NNTP

    2 maximize throughput the packet must go over a netthat maximizes throughput

    SNMP

    4 maximize reliability the packet must be routedover the most reliable net

    SMTP data, DNS zone transfer,

    8 minimize cost the packet must be routedover the least expensive

    route

    Telnet, FTP control, SMTPcommands, DNS UDP

    15 maximize security the packet must be takenover the most secure net

  • 5/27/2018 Preda Vanja

    161/467

    IP ( + )

    16 IP

    65 535

    IP, ICMP, IGMP 16

    ,

  • 5/27/2018 Preda Vanja

    162/467

    IP

    ( 0)

    IP, ICMP, IGMP 17

    TTL ( )

  • 5/27/2018 Preda Vanja

    163/467

    ,

    1

    , TTL = 0

    TTL = 0,

    IP, ICMP, IGMP 18

  • 5/27/2018 Preda Vanja

    164/467

    ,

    ( NAT

    )

    IP, ICMP, IGMP 19

  • 5/27/2018 Preda Vanja

    165/467

    ()

    ( 4)

    n (16)

    IP, ICMP, IGMP 20

    Sender T Receiver-T

  • 5/27/2018 Preda Vanja

    166/467

    ()

    :

    ( 5)

    0,

    0,

    IP, ICMP, IGMP 21

    -

  • 5/27/2018 Preda Vanja

    167/467

    IP, ICMP, IGMP 22

    n bits

    n bits

    all 0s

    n bits

    n bits

    n bits

    n bits

    Sender

    Section 1

    Complement

    PacketSum

    Section 2

    Checksum

    Section k

    If the result is 0, preserve

    the packet otherwisethrow it away

    Checksum

    Checksum

    n bits

    n bits

    n bits

    n bits

    n bits

    n bits

    Receiver

    Section 1

    Complement

    Sum

    Section 2

    Checksum

    Section k

    Result

    -

  • 5/27/2018 Preda Vanja

    168/467

    IP : 01 00 F2 03 F4 F5 F6 F7 00 00 (00 00 e

    ).

    16-

    0100 F203 F4F5 F6F7

    IP, ICMP, IGMP 23

    0000 0001 0000 0000

  • 5/27/2018 Preda Vanja

    169/467

    0000 0001 0000 0000

    1111 0010 0000 00111111 0100 1111 0101

    + 1111 0110 1111 0111

    1101 1110 1110 1111

    + 101101 1110 1111 00011-

    0010 0001 0000 1110

    :

    01 00 F2 03 F4 F5 F6 F7 21 0

    IP, ICMP, IGMP 24

  • 5/27/2018 Preda Vanja

    170/467

    IP, ICMP, IGMP 26

  • 5/27/2018 Preda Vanja

    171/467

    MTU (Maximum Transmission

    Unit)

    (IP)

    ( ),

    IP, ICMP, IGMP 27

    MTU (aximum Transmission Unit)

  • 5/27/2018 Preda Vanja

    172/467

    IP, ICMP, IGMP 28

    Topology MTU (in bytes)

    Hyper-channel 65 535

    16 MB/s Token Ring 17 914

    802.4 Token Bus 8166

    4 MB/s Token Ring 4464

    FDDI 4352

    DIX Ethernet 1500

    Point to Point Protocol (PPP) 1500

    802.3 Ethernet 1492

    Serial Line IP (SLIP) 1006

    X.25 and ISDN 576

    ARCnet 508

    -

  • 5/27/2018 Preda Vanja

    173/467

    IP, ICMP, IGMP 29

    4KB Datagram for 192.168.20.60

    Happy192.168.10.10

    Sneezy192.168.10.40

    Queen192.168.10.3192.168.20.3

    6 packets for 192.168.20.60

    6

    4 2

    1

    5 3

    -

  • 5/27/2018 Preda Vanja

    174/467

    IP, ICMP, IGMP 30

    Sneezy192.168.10.10

    modem

    modem

    modem

    modem

    Datagram for 192.168.30.10

    192.168.10.3192.168.100.1

    192.168.30.1

    172.16.110.1

    192.168.100.100172.16.100.1

    192.168.110.100

    172.16.100.2

    Carriernetwork

  • 5/27/2018 Preda Vanja

    175/467

    IP, ICMP, IGMP 31

    +

    U

    U,

  • 5/27/2018 Preda Vanja

    176/467

    (16 )

    (13 )

    ()

    IP

    IP, ICMP, IGMP 32

    (3 )

  • 5/27/2018 Preda Vanja

    177/467

    IP, ICMP, IGMP 33

    .

    .

    .

    Flag number Bit value Interpretation

    1 0 always set to zero, and preserved for futureuse

    2 0 fragmentation allowed

    1 no fragmentation

    3 0 last fragment1 more fragments to come

    ?

  • 5/27/2018 Preda Vanja

    178/467

    IP, ICMP, IGMP 34

    Inputan IP packetDetermine the size of the datagramIf (size >MTU) then

    If (do not fragment =1)

    Discard the datagram

    Send ICMP message

    Go backElse

    Calculate the max size

    Fragment the datagram

    Add header to each datagram

    Send the datagram

    Go back

    ElseSend the datagram

    End

  • 5/27/2018 Preda Vanja

    179/467

    IP, ICMP, IGMP 35

    .

    Input-datagram from processing

    If (offset = 0 and LF=0) then

    Put the datagram into a queue

    Go backSearch through the reassembly table

    If (failure) then create a new entry

    Insert the fragment into the LL

    If (all fragments in) then

    Reassemble

    Push the datagram to transport

    Go backElse

    If (time-out expired) then discard everything and send ICMP message

    Go back

    /

  • 5/27/2018 Preda Vanja

    180/467

    IP, ICMP, IGMP 36

    IP HEADER Original datagram data area

    IP Hdr Data IP Hdr Data IP Hdr Data 3

    -

  • 5/27/2018 Preda Vanja

    181/467

    IP, ICMP, IGMP 37

    TCP 4444 ( TCP ). Rainy MTU= 1492 bytes TCP . TCP IP 20 .

    Sunny Network B MTU = 508bytes. Network C MTU = 572 bytes.

    Cloudy Sunny.

    .

  • 5/27/2018 Preda Vanja

    182/467

    IP, ICMP, IGMP 38

    Network A

    Network B

    Network C

    The size of the segmentdelivered to IP from TCP is4444 bytes

    MTU = 508

    Cloudy Sunny

    MTU = 1492

    MTU = 572Rainy

    4444 bytes20 bytes

  • 5/27/2018 Preda Vanja

    183/467

    IP, ICMP, IGMP 39

    header

    header

    header

    header

    header

    data

    data

    data

    data

    data

    First fragment

    Second fragment

    Third fragment

    Last fragment

    20 bytes 1472 bytes

    1472 bytes

    20 bytes

    20 bytes

    20 bytes

    1472 bytes

    28 bytes

    1492 bytes

    Rainy

    IP ( + 20 IP )

  • 5/27/2018 Preda Vanja

    184/467

    IP, ICMP, IGMP 40

    fragment fragmentID

    reservedflag

    mayfragment

    morefragments

    fragmentoffset

    packetlength

    1 321 0 0 0 0 4464

    fragment fragmentID

    reservedflag

    mayfragment

    morefragments

    fragmentoffset

    packetlength

    1 321 0 0 1 0 1492

    2 321 0 0 1 184 1492

    3 321 0 0 1 368 1492

    4 321 0 0 0 552 48

    IP

    IP ( + 20 IP )

    Network B

  • 5/27/2018 Preda Vanja

    185/467

    IP, ICMP, IGMP 41

    fragment fragmentID

    reservedflag

    mayfragment

    morefragments

    fragmentoffset

    packetlength

    1 321 0 0 1 0 508

    2 321 0 0 1 61 508

    3 321 0 0 1 122 508

    4 321 0 0 1 183 28

    fragment fragmentID

    reservedflag

    mayfragment

    morefragments

    fragmentoffset

    packetlength

    1 321 0 0 1 184 508

    2 321 0 0 1 245 508

    3 321 0 0 1 306 508

    4 321 0 0 1 367 28

    Network C

  • 5/27/2018 Preda Vanja

    186/467

    IP, ICMP, IGMP 42

    fragment fragmentID

    reservedflag

    mayfragment

    morefragments

    fragmentoffset

    packetlength

    1 321 0 0 0 552 48

    fragment fragmentID

    reservedflag

    mayfragment

    morefragments

    fragmentoffset

    packetlength

    1 321 0 0 1 368 572

    2 321 0 0 1 437 572

    3 321 0 0 1 506 388

    Transport Transport

    IP

  • 5/27/2018 Preda Vanja

    187/467

    IP, ICMP, IGMP 43

    Header-addition

    Forwarding

    Reassembly

    FragmentationProcessing module

    DLLDLL

    MTU table

    Reassemblytable

    Forwardingtable

    Data and DA

    IP

    IP IP NH

    IP

    Data

    IP NH

    IP

    IP

  • 5/27/2018 Preda Vanja

    188/467

    ICMP

    (Internet Control Message Protocol)

    IP, ICMP, IGMP 44

    ICMP?

  • 5/27/2018 Preda Vanja

    189/467

    IP best effort

    :

    ICMP

    IP, ICMP, IGMP 45

    ICMP

  • 5/27/2018 Preda Vanja

    190/467

    IP

    TTL 0

    ICMP

    IP, ICMP, IGMP 46

    ICMP -

  • 5/27/2018 Preda Vanja

    191/467

    ,

    ICMP IP

    ( )

    IP, ICMP, IGMP 47

    ICMP

  • 5/27/2018 Preda Vanja

    192/467

    ICMP

    Destination unreachable

    Time Exceeded

    Source Quench

    Ping

    Ridirect Traceroute

    IP, ICMP, IGMP 48

    Type Name Type Name

  • 5/27/2018 Preda Vanja

    193/467

    IP, ICMP, IGMP 49

    Type Name

    ---- -------------------------0 Echo Reply

    1 Unassigned

    2 Unassigned

    3 Destination Unreachable

    4 Source Quench

    5 Redirect

    6 Alternate Host Address

    7 Unassigned

    8 Echo

    9 Router Advertisement

    10 Router Solicitation

    Type Name

    ---- -------------------11 Time Exceeded

    12 Parameter Problem

    13 Timestamp

    14 Timestamp Reply

    15 Information Request

    16 Information Reply

    Destination unreachable

  • 5/27/2018 Preda Vanja

    194/467

    ICMP

    ICMP

    IP, ICMP, IGMP 50

    -

  • 5/27/2018 Preda Vanja

    195/467

    IP, ICMP, IGMP 51

    Happy192.168.10.10

    Doc192.168.10.60

    Queen192.168.10.3192.168.20.3

    Error:network unreachable

    Packet for 192.168.30.10

    -

  • 5/27/2018 Preda Vanja

    196/467

    IP, ICMP, IGMP 52

    Happy192.168.10.10

    Packet for UDP port 69

    Doc192.168.10.60

    Error: Port unreachable2

    1

  • 5/27/2018 Preda Vanja

    197/467

    IP, ICMP, IGMP 53

    192.168.30.20

    192.168.10.10

    192.168.10.3

    192.168.30.3

    16 KB packet for 192.168.10.10

    Do not fragment

    1.5KB MTU

    Error: fragmentation required

    1

    2

    Source Quench

  • 5/27/2018 Preda Vanja

    198/467

    ( )

    IP, ICMP, IGMP 54

    Redirect -

  • 5/27/2018 Preda Vanja

    199/467

    IP, ICMP, IGMP 55

    R1 redirect

    192.16.1.1

    10.1.1.1

    R2

    Redirect

  • 5/27/2018 Preda Vanja

    200/467

    IP, ICMP, IGMP 56

    192.168.10.10

    192.168.30.10

    192.168.30.1

    192.168.10.1

    Doc

    1 192.168.20.60

    King

    192.168.20.3

    192.168.10.3

    Queen

    Happy

    Packet for 192.168.30.10

    2

    3

    3

  • 5/27/2018 Preda Vanja

    201/467

    IP, ICMP, IGMP 57

    IP L

    L=0, ICMP Time exceeded

    TTL

    IP Parameter problem

  • 5/27/2018 Preda Vanja

    202/467

    IP, ICMP, IGMP 58

    IP

    , IP

    IP Parameter problem

    Time stamp and Time stamp reply

  • 5/27/2018 Preda Vanja

    203/467

    IP, ICMP, IGMP 59

    ICMP Echo Request and Echo Reply

  • 5/27/2018 Preda Vanja

    204/467

    IP, ICMP, IGMP 60

    Ping

    ICMP Echo

    Traceroute

    ICMP Echo 1 TTL.

    TTL=1, TTL=2

    . Time exceeds

    Echo request, Echo reply

  • 5/27/2018 Preda Vanja

    205/467

    IP, ICMP, IGMP 61

    Happy192.168.10.10

    Echo request

    Duck192.168.10.40

    Echo reply2

    1

    Query messages

    Echo request cho reply

  • 5/27/2018 Preda Vanja

    206/467

    IP, ICMP, IGMP 62

    192.168.30.10

    192.168.10.10

    Doc

    1

    2 fragments containing Echo reply

    192.168.30.3

    192.168.10.3

    Queen

    Happy

    2KB Echo request for 192.168.20.10

    4

    3

    2

    Solicitation advertisement

  • 5/27/2018 Preda Vanja

    207/467

    IP, ICMP, IGMP 63

    defaultgateway, (route discovery) ICMP router solicitation

    (224.0.0.2 )

    advertisement ICMP

    Advertisement

    Router discovery -

    KingHappyadvertisement preference 102

  • 5/27/2018 Preda Vanja

    208/467

    IP, ICMP, IGMP 64

    192.168.30.10

    192.168.30.10

    192.168.20.60

    192.168.30.1

    192.168.10.1

    192.168.10.1

    192.168.10.1Queen

    Sleepy

    2

    1router solicitation

    advertisement preference

    advertisement preference 10

    Router discovery -

  • 5/27/2018 Preda Vanja

    209/467

    IP, ICMP, IGMP 65

    192.168.30.10

    192.168.30.10

    192.168.20.60

    192.168.30.1192.168.10.1

    192.168.10.1192.168.10.1

    Queen

    King

    Sleepy

    Happy

    4

    32

    packet for 192.168.30.101

    ICMP

  • 5/27/2018 Preda Vanja

    210/467

    ICMP IP

    ,

    IP, ICMP, IGMP 66

    ICMP

  • 5/27/2018 Preda Vanja

    211/467

    IP, ICMP, IGMP 67

    ICMP

    ype

    Code

    Checksum

    ?

    ICMP ?

  • 5/27/2018 Preda Vanja

    212/467

    IP, ICMP, IGMP 69

    ?

    ?

    ICMP

    ICMP

  • 5/27/2018 Preda Vanja

    213/467

    IP, ICMP, IGMP 70

    ICMP

    MTU ICMP

  • 5/27/2018 Preda Vanja

    214/467

    .

    MTU ,

    ICMP

    ICMP

    MTU.

    MTU.

    ,

    MTU.

    IP, ICMP, IGMP 71

    MTU -

    192.168.100.100172 16 100 1

    1500 byte

  • 5/27/2018 Preda Vanja

    215/467

    IP, ICMP, IGMP 72

    192.168.10.10

    192.168.100.10

    modem modem

    172.16.100.1

    Carriernetwork

    192.168.100.70

    172.16.60.70

    1500 byteMTU

    1500 byteMTU

    512 byte

    MTU

    MTU

    1500 bytes packetfor 192.168.100.10

    1

    2

    ICMP

    (firewalls)

  • 5/27/2018 Preda Vanja

    216/467

    IP, ICMP, IGMP 73

    ICMP

    MTU

    ICMP

    Echo

  • 5/27/2018 Preda Vanja

    217/467

    IGMP

    (Internet Group Management Protocol)

    IP, ICMP, IGMP 74

  • 5/27/2018 Preda Vanja

    218/467

    ,

    IP, ICMP, IGMP 75

    Destination

  • 5/27/2018 Preda Vanja

    219/467

    IP, ICMP, IGMP 76PIO TCP/IP Networking 76

    Unicast

    Source

    Router

    Router

    Source

    Multicast

    Destination

    Destination

    Destination

    Destination

    Destination

  • 5/27/2018 Preda Vanja

    220/467

    D (224.0.0.0239.255.255.255

    224.0.0.0 224.0.0.25

    224.0.0.1

    IP, ICMP, IGMP 77

  • 5/27/2018 Preda Vanja

    221/467

    IP, ICMP, IGMP 78

    IGMP e

    .

    Sleepy

  • 5/27/2018 Preda Vanja

    222/467

    IP, ICMP, IGMP 79

    Happy192.168.10.10

    py

    192.168.20.60

    Queen192.168.10.3192.168.20.3

    224.1.2.3

    Sneezy192.168.10.40

    224.1.2.3

    ?

  • 5/27/2018 Preda Vanja

    223/467

    IP, ICMP, IGMP 80

    R IGMP Membership-Report

  • 5/27/2018 Preda Vanja

    224/467

    224.2.0.1

    DR za

    pripadnost na grupata

    DR

    DR

    IP, ICMP, IGMP 81

    R

    R: ReceiverDR: Designated Router

    Network A

    DR

  • 5/27/2018 Preda Vanja

    225/467

    R e

    ,

    DR

    IP, ICMP, IGMP 82

    Data to 224.2.0.1

    R

    R

    R: Receiver

    DR: Designated Router

    IGMP Leave-Group

    Network A

    IGMP

    8 bytes20 bytes14 bytes

  • 5/27/2018 Preda Vanja

    226/467

    IP, ICMP, IGMP 83

    Ethernet Header IP header IGMP

    Message

    Version

    (= 0)

    Type

    (=1-2)(unused)

    32-bit Class D address

    Checksum

    IGMP 8 (query report)

    IGMP

  • 5/27/2018 Preda Vanja

    227/467

    IP, ICMP, IGMP 84

    Queen192.168.10.3192.168.20.3

    joining 224.0.1.1 sent to 224.0.1.1

    Sneezy192.168.10.40

    Doc192.168.10.30

    Merlin192.168.10.5

    Happy192.168.10.10

  • 5/27/2018 Preda Vanja

    228/467

    NAT, DHCP, ARP 1

    5

    NAT, DHCP, ARP

  • 5/27/2018 Preda Vanja

    229/467

    IPv4

    (NAT)

    (DHCP)

    () IP

    RP (Address Resolution

    Protocol)

    NAT, DHCP, ARP 2

  • 5/27/2018 Preda Vanja

    230/467

    IPv4

    NAT, DHCP, ARP 3

  • 5/27/2018 Preda Vanja

    231/467

    NAT (Network

    Address Translation)

    DHCP (Dynamic Host Configuration Protocol)

    NAT, DHCP, ARP 4

  • 5/27/2018 Preda Vanja

    232/467

    NAT, DHCP, ARP 5

    IP

    NAT (Network Address Translation)

    ?

  • 5/27/2018 Preda Vanja

    233/467

    NAT, DHCP, ARP 6

    ,

    ,

    NAT

    Src. Add. Dest. Add. Src. Add. Dest. Add.

  • 5/27/2018 Preda Vanja

    234/467

    NAT, DHCP, ARP 7

    Localhost

    Remotehost

    NAT10.1.1.1 193.1.1.1.

    10.1.1.1 193.1.1.1Before NAT

    Outbound packet

    14.38.1.1 193.1.1.1After NAT

    Outbound packet

    Dest. Add.14.38.1.1

    Src. Add.193.1.1.1

    Before NAT

    Return packet

    Dest. Add.10.1.1.1

    Src. Add.193.1.1.1

    After NAT

    Return packet

    NAT IP

    Internet

    NAT -

    (Inside local address)

    Internal IP header

  • 5/27/2018 Preda Vanja

    235/467

    NAT, DHCP, ARP 8

    (Inside globaladdress)

    (Outside localaddress)

    (Outside globaladdress)

    Source Address

    10. 1. 1. 1

    DestinationAddress

    193. 1. 1. 1

    Source Address

    14. 38. 1. 1

    DestinationAddress

    193. 1. 1. 1

    Inside local address Outside local address

    NAT

    Inside global address Outside global address

    External IP header

    NAT

  • 5/27/2018 Preda Vanja

    236/467

    NAT, DHCP, ARP 9

    (

    )

    NAT

    , .

    PAT (Port Address Translation) Dynamic

    NAT with overload Masquerading

    NAT

    Inside local

    Address

    Inside global

    Address

  • 5/27/2018 Preda Vanja

    237/467

    NAT, DHCP, ARP 10

    NAT

    PAT

    Inside local

    address

    Inside local

    Port

    Inside global

    address

    Outside

    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

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

    172.18.3.1 25.8.3.2

    172.18.3.2 25.8.3.2

    ... ...

    NAT -

  • 5/27/2018 Preda Vanja

    238/467

    NAT, DHCP, ARP 11

    ISP

    , NAT

    NAT round-robin

    NAT

  • 5/27/2018 Preda Vanja

    239/467

    NAT, DHCP, ARP 12

    NAT -

  • 5/27/2018 Preda Vanja

    240/467

    NAT, DHCP, ARP 13

    checksum IP

    checksum

    ,

    nd-to-end

  • 5/27/2018 Preda Vanja

    241/467

    NAT, DHCP, ARP 14

    ,

    IP

  • 5/27/2018 Preda Vanja

    242/467

    IP

    (subnet mask) (default

    gateway)

    (DNS

    )

    NAT, DHCP, ARP 15

  • 5/27/2018 Preda Vanja

    243/467

    , ,

    NAT, DHCP, ARP 16

    Dynamic Host Configuration

    Protocol (DHCP)

  • 5/27/2018 Preda Vanja

    244/467

    NAT, DHCP, ARP 17

    DHCP

    RARP RP BOOTP

    DHCP BOOTP

    UDP

    RARP (Reverse ARP)

    RARP ARP

  • 5/27/2018 Preda Vanja

    245/467

    NAT, DHCP, ARP 18

    IP RARPrequest

    IP 0.0.0.0 255.255.255.255. MAC

    ,

    RARP IP IP

    .default gateway DNS

    1985 .

    BOOTP (BOOTstrap Protocol)

    IP

    ( 199 )

  • 5/27/2018 Preda Vanja

    246/467

    NAT, DHCP, ARP 19

    ( 1995.)

    IP , , IP default

    gateway, IP DNS

    BOOTP DHCP

    IP

    DHCP

    (

  • 5/27/2018 Preda Vanja

    247/467

    ( )

    (

    )

    BOOTP

    DHCP ,

    DHCP

    NAT, DHCP, ARP 20

    DHCP?

    DHCP

  • 5/27/2018 Preda Vanja

    248/467

    NAT, DHCP, ARP 21

    DHCP

    ,

    .

    DHCP ,

    IP

    DHCP

    DHCP DHCP

    DHCP

  • 5/27/2018 Preda Vanja

    249/467

    NAT, DHCP, ARP 22

    IP Lease Selection

    IP Lease Request

    IP Lease Offer

    IP Lease

    Acknowledgment

    DHCP

    1 DHCPDISCOVER DHCP

  • 5/27/2018 Preda Vanja

    250/467

    NAT, DHCP, ARP 23

    1 DHCPDISCOVER DHCP

    2 DHCPOFFER

    3 DHCPREQUEST

    4 DHCPDECLINE

    5 DHCPACK

    6 DHCPNAK

    7 DHCPRELEASE

    8 DHCPINFORM

    DHCP 1

    DHCP Client00:a0:24:71:e4:44 DHCP Server

    DHCPDISCOVERS t t 255 255 255 255

  • 5/27/2018 Preda Vanja

    251/467

    NAT, DHCP, ARP 24

    DHCP Discover

    DHCP Offer

    Sent to 255.255.255.255

    DHCP Server

    DHCP Client00:a0:24:71:e4:44 DHCP Server

    DHCP Server

    DHCPOFFER

    DHCPOFFER

    DHCPDISCOVER

    Source IP Address = 0.0.0.0

    Dest IP Address = 255 255 255 255

    DHCP 1 (.)

    DHCP

  • 5/27/2018 Preda Vanja

    252/467

    NAT, DHCP, ARP 25

    DHCP ServerDHCP Client

    Dest. IP Address = 255.255.255.255Hardware Address = 08004....

    IP Router

    DHCPOFFER

    Source IP Address = 131.107.3.24

    Dest. IP Address = 255.255.255.255

    Offered IP Address = 131.107.8.13

    Client Hardware Address = 08004...Subnet Mask = 255.255.255.0

    Length of Lease = 72 hours

    Server Identifier = 131.107.3.24

    DHCP

    DHCP 2

    DHCP Request with ACK

  • 5/27/2018 Preda Vanja

    253/467

    NAT, DHCP, ARP 26

    .

    DHCP Client00:a0:24:71:e4:44 DHCP Server

    DHCP Server

    DHCPREQUEST

    DHCPACK

    DHCPREQUEST

    Source IP Address = 0.0.0.0

    Dest. IP Address = 255.255.255.255

    Hardware Address = 08004....

    Requested IP Address = 131 107 8 13

    DHCP 2 (.)

  • 5/27/2018 Preda Vanja

    254/467

    NAT, DHCP, ARP 27

    DHCP ServerDHCP Client

    Requested IP Address = 131.107.8.13Server Identifier = 131.107.3.24

    IP Router

    DHCPACK

    Source IP Address = 131.107.3.24

    Dest. IP Address = 255.255.255.255

    Offered IP Address = 131.107.8.13

    Client Hardware Address = 08004...

    Subnet Mask = 255.255.255.0Length of Lease = 72 hours

    Server Identifier = 131.107.3.24

    DHCP Option: Router = 131.107.8.1

    DHCP

    DHCP Request with ACK

    DHCP Client

    00:a0:24:71:e4:44 DHCP Server

  • 5/27/2018 Preda Vanja

    255/467

    NAT, DHCP, ARP 28

    ( 50% )(ipconfig/renew)

    DHCP DHCPNACK, .

    00:a0:24:71:e4:44 DHCP Server

    DHCP Server

    DHCPREQUEST

    DHCPACK

    DHCP IP

    (ipconfig/release)

    DHCP Client00:a0:24:71:e4:44 DHCP Server

    DHCP Server

    DHCPRELEASE

    DCHP Release

  • 5/27/2018 Preda Vanja

    256/467

    ARP (Address Resolution Protocol)

    NAT, DHCP, ARP 29

    MAC

  • 5/27/2018 Preda Vanja

    257/467

    NAT, DHCP, ARP 30

    ( ) MAC

    48

  • 5/27/2018 Preda Vanja

    258/467

    NAT, DHCP, ARP 31

    48

    ( )

    3 (IEEE).

    3 .

    Vendor code or OUI(Organizationaly UniqueIdentifier), assigned by IEEE

    Vendors assigned. Vendorsare responsible for theuniquenss

    01 12 23 34 a3 b4

    ()

  • 5/27/2018 Preda Vanja

    259/467

    NAT, DHCP, ARP 32

    , ()

    ,

    ,

    IP MAC

    IP

  • 5/27/2018 Preda Vanja

    260/467

    NAT, DHCP, ARP 33

    IP .

    MAC

    IP

    The Address Resolution Protocol (ARP)

    ARP

  • 5/27/2018 Preda Vanja

    261/467

    NAT, DHCP, ARP 34

    ARP

    ARP

    ,

    ARP

    IP

    ARP RARP

    ARP RARP (Reverse ARP)

  • 5/27/2018 Preda Vanja

    262/467

    NAT, DHCP, ARP 35

    RARPEthernet MAC

    address(48 bit)

    ARPIP address(32 bit)

    ARP RARP (Reverse ARP) IP MAC

    ARP?

    IP

  • 5/27/2018 Preda Vanja

    263/467

    NAT, DHCP, ARP 36

    IP IP (ARP request).

    IP

    ARP

    IP ARP

  • 5/27/2018 Preda Vanja

    264/467

    NAT, DHCP, ARP 37

    IP ARP

    ARP

    ARP

  • 5/27/2018 Preda Vanja

    265/467

    NAT, DHCP, ARP 38

    ARP

    IP ( )

  • 5/27/2018 Preda Vanja

    266/467

    NAT, DHCP, ARP 39

    IP ( ) ARP 9

    Hardware type

    Protocol type

    Hardware address length Protocol address length

    Message type

    Source hardware address

    Source IP address

    Destination hardware address Destination IP address

    ARP

    Destination

    address

    6

    ARP Request or ARP Reply

    28

    Source

    address

    6 2

    CRC

    4

    Type

    0x8060Padding

    10

    Ethernet II header

  • 5/27/2018 Preda Vanja

    267/467

    NAT, DHCP, ARP 40

    Hardware type (2 bytes)

    Hardware address

    length (1 byte)

    Protocol address

    length (1 byte)Operation code (2 bytes)

    Target hardware address*

    Protocol type (2 bytes)

    Source hardware address*

    Source protocol address*

    Target protocol address*

    * Note: The length of the address fields is determined by the corresponding address length fields

    RP TCP/IP

    SMTP FTP

    TELNET DNS

    HTTP Application

    Presentation

  • 5/27/2018 Preda Vanja

    268/467

    NAT, DHCP, ARP 41

    Transport

    Network

    Application

    Physical

    TELNET DNS PresentationSession

    TransportTCP UDP

    NetworkIGMPICMP

    IP

    DHCPARP

    Data Link

    Physical

    Protocols defined by the

    underlying networks

    Domain

    Happy

    Sneezy

    DNS serverfor itm.se

    Sl

  • 5/27/2018 Preda Vanja

    269/467

    NAT, DHCP, ARP 42

    Happy (ARP ),

    sleepy (ping sleepy).

    IP IP

    sneezy DNS IP R

    172.16.5.3172.16.5.2172.16.5.1

    Domainitm.se

    SneezySleepy

    R

    172.16.5.4

    1. Happy ARP request Sneezy

    2. Sneezy ARP response

    3 Happy DNS neezy

  • 5/27/2018 Preda Vanja

    270/467

    NAT, DHCP, ARP 43

    3. Happy DNS neezy IP Sleepy

    4. Sneezy IP Sleepy

    5. IP Sleepy, Happy

    Sleepy

    6. HappyARP request Sleepy

    7. Sleepy ARP response

    8. Happy leepy

  • 5/27/2018 Preda Vanja

    271/467

    NAT, DHCP, ARP 44

    E7E6

    H0 H1 H4 H5 H8 H9

    E1I1I0 E0 E4I4 E5I5 E8I8 E9I9

    I7I6E3

    I11

    E2

    I10 LAN 2 LAN 3LAN 1R1 R2

    IP ? 4 : ping H9.

    ?

    ARP

  • 5/27/2018 Preda Vanja

    272/467

    NAT, DHCP, ARP 45

    ? ARP

    . . ARP

    IP ?

    ARP (request)

    Proxy ARP

    ( )

    access router

  • 5/27/2018 Preda Vanja

    273/467

    NAT, DHCP, ARP 46

    access router

    H0 H1 H4 H5

    E1I1I0 E0 E4I4 E5I5

    E3

    I11

    E2

    I10 LAN 2LAN 1R1

    H0 asks R1 forMAC address

    of H4R1 can provide an answer since ithas this MAC address in its cache

    Gratuitous ARP

    ARP

  • 5/27/2018 Preda Vanja

    274/467

    NAT, DHCP, ARP 47

    ARP IP

    IP

    Gratuitous ARP

    DHCP

  • 5/27/2018 Preda Vanja

    275/467

    6

    IPv6,

    IPv6

  • 5/27/2018 Preda Vanja

    276/467

    IPv4

    IPv6, 2

  • 5/27/2018 Preda Vanja

    277/467

    IP 6

    IPv4

    (CIDR, NAT, DHCP

    , )

  • 5/27/2018 Preda Vanja

    278/467

    , )

    ( Best effort )

    IPv6, 4

    IPv6

    128-

  • 5/27/2018 Preda Vanja

    279/467

    40

    IPSec

    IPv6, 5

    6

  • 5/27/2018 Preda Vanja

    280/467

    6

    (40 )

    IPv6, 6

    0 311612 244

  • 5/27/2018 Preda Vanja

    281/467

    IPv6, 7

    0 3116

    flow labelversion traffic class

    next headerpayload length hop limit

    destination address

    source address

    12 244

    (4 )

    (8 )

  • 5/27/2018 Preda Vanja

    282/467

    (8 )

    (20 )

    (16 )

    (8 )

    (8 )

    (128 )

    (128 )

    IPv6, 8

    6 IPv6

  • 5/27/2018 Preda Vanja

    283/467

    6 IPv6

    IPv6, 9

  • 5/27/2018 Preda Vanja

    284/467

    (

    )

    IPv6, 10

  • 5/27/2018 Preda Vanja

    285/467

    65535 (16) 64

    . 0

    IPv6, 11

  • 5/27/2018 Preda Vanja

    286/467

    ()

    IP e (TCP,

    UDP)

    ( TTL IPv4)

    IPv6, 12

    ()

    6 ,

  • 5/27/2018 Preda Vanja

    287/467

    Hop by hop

    Routing

    Fragment

    Authentication

    Encrypted security Destination options

    IPv6, 13

    ()

  • 5/27/2018 Preda Vanja

    288/467

    a

    IPv6, 14

    s d

  • 5/27/2018 Preda Vanja

    289/467

    IPv6, 15

    g

    gs

    g

    Anycast

    a

    as

    a

    Link local

  • 5/27/2018 Preda Vanja

    290/467

    Site local

    IPv6, 16

    Global Link localSite local

    0 6432 96

    TLA NLA Interface identifierSLA

  • 5/27/2018 Preda Vanja

    291/467

    TLATop Level Aggregator assigned for 8Kmajor providers(13+3bits)

    NLANext Level Aggregator assigned for smaller providers

    SLASite Level Aggregator subnetnumbers within organizations (16bits)

    IPv6, 17

    0 82 4 6 10 12 14

    NLA1 NLA2 NLA3

    *

    ()

  • 5/27/2018 Preda Vanja

    292/467

    ( ) IPv4,

    ( IPv4)

    IGMP IPv6

    ICMP (

    IGMP IPv4)

    IPv6, 18

    IPv6

    ( IPv4-

    ) :

  • 5/27/2018 Preda Vanja

    293/467

    )

    :

    IPv6, 19

    IPv6

    3ffe:0501:0008:0000:0260:97ff:fe40:efab

  • 5/27/2018 Preda Vanja

    294/467

    3ffe:501:8:0:260:97ff:fe40:efab

    3ffe:501:8::260:97ff:fe40:efab

    ff02:0000:0000:0000:0000:0000:0000:0001

    ff02:0:0:0:0:0:0:1

    ff02::1

    IPv6, 20

    ::

  • 5/27/2018 Preda Vanja

    295/467

    ::1

    loopback ( 127.0.0.1 IPv4) ping ::1

    IP

    IPv6, 21

  • 5/27/2018 Preda Vanja

    296/467

    Stateless

    ( 3

    ) Local Link (

    )

    Stateful

    DHCP kaj IPv4

    IPv6, 22

    IPv4 IPv6

    IPv6

  • 5/27/2018 Preda Vanja

    297/467

    6

    4

    4

    IPv6, 23

  • 5/27/2018 Preda Vanja

    298/467

    6

    (dual

    stack)

    4

    IPv6, 24

    dual stack

    6

  • 5/27/2018 Preda Vanja

    299/467

    4

    IPv6, 25

    TCP

    IPv4 IPv6

    TCP

    IPv6

    TCP

    IPv4

    IPv4-onlyIPv6-only

    6

  • 5/27/2018 Preda Vanja

    300/467

    IPv4,

    IPv6 IPv4

    IPv4 IPv6

    IPv6, 26

    IPv6

    IPv6

  • 5/27/2018 Preda Vanja

    301/467

    IPv4

    IPv6, 27

    IPv6 packet

    IPv4 header IPv6 packet

    IPv6 only IPv6 only HappyFunny

    destinationsource

    IPv4

  • 5/27/2018 Preda Vanja

    302/467

    IPv6, 28

    IPv6

    Data

    IPv6

    DataIPv6 /IPv4 IPv4/IPv6

    Queenrouter King-router

    IPv4 King

    IPv6 Happy

    Data

    IPv4Network

  • 5/27/2018 Preda Vanja

    303/467

  • 5/27/2018 Preda Vanja

    304/467

    IPv6, 30

    (Classless inter-domain routingCIDR)

    IP

  • 5/27/2018 Preda Vanja

    305/467

    IPv6, 31

    IP IP

    IP

  • 5/27/2018 Preda Vanja

    306/467

    IPv6, 32

    (forwarding)

  • 5/27/2018 Preda Vanja

    307/467

    (forwarding)

    (routing)

    TTL

    ICMP ....

    IPv6, 33

    Switching fabric

    Output PortsForwarding

    Table

    ForwardingD i i

    Input Ports + Processing

  • 5/27/2018 Preda Vanja

    308/467

    IPv6, 34

    Decision

    ForwardingTable

    ForwardingDecision

    ForwardingTable

    ForwardingDecision

    IP

  • 5/27/2018 Preda Vanja

    309/467

    (

    ) Next hop

    () ( ). IP

    ,

    IPv6, 35

    ,

  • 5/27/2018 Preda Vanja

    310/467

    ()

    .

    IPv6, 36

    direct/(conn )

    Destination Next Hop Interface

    R1

  • 5/27/2018 Preda Vanja

    311/467

    direct/(conn.) R1 IP,

    IP ,

    .

    IPv6, 37

    10.1.0.0/24

    10.1.2.0/24

    10.2.1.0/24

    10.3.0.0/1620.1.0.0/16

    20.2.1.0/28

    R3

    direct /(conn.)

    direct /(conn.)

    R3R2

    R2

    Eth0/0

    Eth0/2

    Eth0/0

    Eth0/0serial0

    serial0

    Destination Next Hop

    10.1.0.0/2410.1.2.0/2410.2.1.0/2410.3.1.0/24

    20.2.0.0/1630.1.1.0/28

    R3directdirectR3

    R2R2

    Destination Next Hop

    10.1.0.0/2410.1.2.0/2410.2.1.0/2410.3.1.0/24

    20.1.0.0/1620.2.1.0/28

    R1R1directR4

    directdirect

    Destination Next Hop

    10.1.0.0/2410.1.2.0/2410.2.1.0/2410.3.1.0/24

    20.1.0.0/1620.2.1.0/28

    R2R2R2R2

    R2direct

  • 5/27/2018 Preda Vanja

    312/467

    IPv6, 38

    to:

    20.2.1.2

    Destination Next Hop

    10.1.0.0/2410.1.2.0/24

    10.2.1.0/2410.3.1.0/2420.1.0.0/1620.2.1.0/28

    directR3

    R3R3R3R3

    H1

    R1 R2

    R3 R4

    H2

    10.2.1.0/24

    20.1.0.0/1610.1.2.0/24

    10.1.0.0/24 10.3.0.0/16

    20.2.1.0/28

    20.2.1.2/28

    Destination Next Hop

    10.1.0.0/2410.1.2.0/24

    10.2.1.0/2410.3.1.0/2420.1.0.0/1620.2.1.0/28

    directdirect

    R4directR4R4

    Destination Next Hop

    10.1.0.0/2410.1.2.0/24

    10.2.1.0/2410.3.1.0/2420.1.0.0/1620.2.1.0/28

    R3R3

    R2directdirectR2

    Destination Next Hop

    10.1.0.0/2410.1.2.0/2410.2.1.0/2410.3.1.0/2420.2.0.0/1630.1.1.0/28

    R3directdirectR3R2R2

    Destination Next Hop

    10.1.0.0/2410.1.2.0/2410.2.1.0/24

    10.3.1.0/2420.1.0.0/1620.2.1.0/28

    R1R1direct

    R4directdirect

    Destination Next Hop

    10.1.0.0/2410.1.2.0/2410.2.1.0/24

    10.3.1.0/2420.1.0.0/1620.2.1.0/28

    R2R2R2

    R2R2direct

  • 5/27/2018 Preda Vanja

    313/467

    IPv6, 39

    to:

    20.2.1.2

    Destination Next Hop

    10.1.0.0/2410.1.2.0/24

    10.2.1.0/2410.3.1.0/2420.1.0.0/1620.2.1.0/28

    directR3

    R3R3R3R3

    H1

    R1 R2

    R3 R4

    H2

    10.2.1.0/24

    20.1.0.0/1610.1.2.0/24

    10.1.0.0/24 10.3.0.0/16

    20.2.1.0/28

    20.2.1.2/28

    Destination Next Hop

    10.1.0.0/2410.1.2.0/24

    10.2.1.0/2410.3.1.0/2420.1.0.0/1620.2.1.0/28

    directdirect

    R4directR4R4

    Destination Next Hop

    10.1.0.0/2410.1.2.0/24

    10.2.1.0/2410.3.1.0/2420.1.0.0/1620.2.1.0/28

    R3R3

    R2directdirectR3

    R4 R3

  • 5/27/2018 Preda Vanja

    314/467

    Network route IP ( 10.0.2.0/24)

    Host route IP ( 10.0.1.2/32) Default route

    ( default gateway gatewayof last resort)

    Loopback address ( )

    IPv6, 40

    Default route?

    (

    )

  • 5/27/2018 Preda Vanja

    315/467

    )

    IPv6, 41

    ?

  • 5/27/2018 Preda Vanja

    316/467

    ,

    IPv6, 42

    ICMP

  • 5/27/2018 Preda Vanja

    317/467

    ICMP

    IPv6, 43

    (1) IP datagram

    R1

    (2) IP datagram

    (3) ICMP redirect

    DestinationNext Hop10.1.0.0/24

    R2

    DestinationNext Hop

    10.1.0.0/24

    R1

    Ethernet

    H1

    R1 R2

    ICMP

    Windows

  • 5/27/2018 Preda Vanja

    318/467

    IPv6, 44

    Cisco

  • 5/27/2018 Preda Vanja

    319/467

    IPv6, 45

    (Forwarding) (Routing)

    :

  • 5/27/2018 Preda Vanja

    320/467

    IPv6, 46

    :

    1. :

    ?

    2. :

    ?

    IP

    (, ) IP

  • 5/27/2018 Preda Vanja

    321/467

    IPv6, 47

    ,

    IP ,

    ,

    IP

    UDP TCPRouting

    Protocol

    Static

    routing

  • 5/27/2018 Preda Vanja

    322/467

    IPv6, 48

    Input

    queue

    Lookup next

    hopDestination

    address local?

    Yes

    Send

    datagram

    IP forwarding

    enabled?

    No

    Discard

    Yes No

    Demultiplex

    forwarding(routing)

    table

    IP module

    Data Link Layer

    IP

    1. IP (

    0)

    2 IP

    IP

  • 5/27/2018 Preda Vanja

    323/467

    IPv6, 49

    2. IP

    3. IP

    4.

    5. TTL

    6. ( )

    7.

    8.

    9. ICMP ( )

    IP

  • 5/27/2018 Preda Vanja

    324/467

    IPv6, 50

    IP

  • 5/27/2018 Preda Vanja

    325/467

    IPv6, 51

    IP ( )

    , , ,

  • 5/27/2018 Preda Vanja

    326/467

    IPv6, 52

    Next hop( )

    , default route

    default route

    default route No route to host ICMP

    (CIDR)

  • 5/27/2018 Preda Vanja

    327/467

    IPv6, 54

    (Longest prefix match)

    Host route 32 Default router 0

    32

    ength

    .

    : ,

    .

  • 5/27/2018 Preda Vanja

    328/467

    IPv6, 55

    8

    24

    Prefixes

    PrefixLe

    128.9.0.0/16 142.12.0.0/1965.0.0.0/8

    128.9.16.14

    128.9.172.0/21

    128.9.176.0/24

    128.9.16.0/21

    128.9.16.14 128.9.16.0/21 21 128.9.16.14 128.9.0.0/16 16

    128.9.16/21

    A

    0 1

    D

    Root

    Route Prefixes

    A 0*

  • 5/27/2018 Preda Vanja

    329/467

    IPv6, 56

    0

    0

    0

    1

    1

    0

    0 0

    0 0

    1

    1

    1 1

    B

    C E

    F G H I

    B 01000*

    C 011*

    D 1*

    E 100*

    F 1100*

    G 1101*

    H 1110*

    I 1111*

    CIDR ISP X 16 C 200.23.16.0 200.23.31.0 (200.23.16/20)

    AdjacentISP ISP X

    1 Destination Interface

    200.23.16/21 21

  • 5/27/2018 Preda Vanja

    330/467

    IPv6, 57

    200.23.16.0/24, 200.200.17.0/24

    200.23.18.0/24, 200.200.19.0/24200.23.20.0/24, 200.200.21.0/24

    200.23.22.0/24, 200.200.23.0/24

    Largecompany

    200.23.16.

    0/21

    Mediumcompany

    200.23.24.0/

    22

    200.23.24.0/24

    200.23.25.0/24200.23.26.0/24

    200.23.27.0/24

    Smallcompany

    200.23.28.

    0/23

    200.23.28.0/24

    200.23.29.0/24

    Tinycompany

    200.23.30.

    0/24

    router

    Destination Interface

    200.23.16/20 1

    200.23.24/22 3

    200.23.28/23 4

    200.23.30/24 5

    0.0.0.0 1

    23 4

    5

    ()

    .

  • 5/27/2018 Preda Vanja

    331/467

    IPv6, 58

    Destination Next Hop

    10.1.0.0/2410.1.2.0/2410.2.1.0/24

    10.3.1.0/2420.0.0.0/8

    R3directdirect

    R3R2

    Destination Next Hop

    10.1.0.0/2410.1.2.0/2410.2.1.0/2410.3.1.0/24

    20.2.0.0/1620.1.1.0/28

    R3directdirect

    R3

    R2R2

    ?

    /

  • 5/27/2018 Preda Vanja

    332/467

    IPv6, 59

    ?

    ?

    ?

    ? .

  • 5/27/2018 Preda Vanja

    333/467

    7,

  • 5/27/2018 Preda Vanja

    334/467

    Default route

    A

    , 2

    ,,

    IP

  • 5/27/2018 Preda Vanja

    335/467

    IP ,

    ()

    , 3

    (

    )

  • 5/27/2018 Preda Vanja

    336/467

    , 4

    ( )

    ,

  • 5/27/2018 Preda Vanja

    337/467

    ()

    ,

    ,

    , 5

  • 5/27/2018 Preda Vanja

    338/467

    , 6

  • 5/27/2018 Preda Vanja

    339/467

    (

    )

    , 7

    - R1-R2,

    AR2

  • 5/27/2018 Preda Vanja

    340/467

    , 88

    B R2

    C R3

    B

    C

    R1

    R2

    R3 R4

    R1s routing table

    A

    direct

    (connected)

    Next hopDestin

    ation

    ?

  • 5/27/2018 Preda Vanja

    341/467

    stub network

    , 9

    Default Route

    stub networks

  • 5/27/2018 Preda Vanja

    342/467

    default route

    Default route

    , 10

    ( )

    ,

  • 5/27/2018 Preda Vanja

    343/467

    , 11

    Routing versus Routed Protocols

    Routing protocols ( )

  • 5/27/2018 Preda Vanja

    344/467

    Routed protocols ( )

    IP (kaj Internet), IPX (kaj Novell)

    , 12

    ( )

  • 5/27/2018 Preda Vanja

    345/467

    , 13

  • 5/27/2018 Preda Vanja

    346/467

    ,

    , 14

    Ka

  • 5/27/2018 Preda Vanja

    347/467

    ( )

    , 15

    Ka (.)

    /

  • 5/27/2018 Preda Vanja

    348/467

    /

    , 16

    Ka (.)

  • 5/27/2018 Preda Vanja

    349/467

    ,

    , 17

    (flooding)

  • 5/27/2018 Preda Vanja

    350/467

    (flooding)

    (random routing)

    (hot-potato routing)

    (Shortest path routing, Least cost routing)

    , 18

  • 5/27/2018 Preda Vanja

    351/467

    A

    B

    C

    D

    E

    FA

    B

    C

    D

    E

    FA

    B

    C

    D

    E

    F

  • 5/27/2018 Preda Vanja

    352/467

    ,

    , 20

    A

    B

    C

    D

    E

    F

    A

    B

    C

    D

    E

    F

    A

    B

    C

    D

    E

    F

    B

    C

    D

    E

    F

    B

    C

    D

    E

    FA

    () ()

  • 5/27/2018 Preda Vanja

    353/467

    ()

    ( -)

    ()

    , 21

    D

    5

    2

    3

    3

    5C

    A

    B

    12 Destin Next Distn

  • 5/27/2018 Preda Vanja

    354/467

    , 22

    E F

    11

    2

    C

    A

    B

    D

    2

    11

    21

    ation hop ce

    B B 2

    C E 3

    D E 4

    E E 1

    F E 2E F

  • 5/27/2018 Preda Vanja

    355/467

    (,

    )

    , 23

    ()

  • 5/27/2018 Preda Vanja

    356/467

    , 24

    6

    5

    2

    3

    3

    53

    1

    4 5

    2

    1

    1

    2

    1

  • 5/27/2018 Preda Vanja

    357/467

    ( backup)

    , 25

  • 5/27/2018 Preda Vanja

    358/467

    , 26

    (distance vector

    protocols)

  • 5/27/2018 Preda Vanja

    359/467

    p )

    (

    )

    -

    , 29

    140

    140

    :

    , .

    , ,

    .

  • 5/27/2018 Preda Vanja

    360/467

    , 30

    minimum (185 175, 210) = 175

    Destination Next hop Distance 175

    140km away

    180km

    140km 140+45=185

    140+35=175

    180+30=210

    Routing Information Protocol (RIP)

    koj e GGP

  • 5/27/2018 Preda Vanja

    361/467

    , 31

  • 5/27/2018 Preda Vanja

    362/467

    ()

    , 33

    OSPF (Open Shortest Path First)

    RIP

  • 5/27/2018 Preda Vanja

    363/467

    OSPF IPv6

    , 34

  • 5/27/2018 Preda Vanja

    364/467

    , 36

    IP ( )

    (AutonomousSystems, AS)

    A ()

    ( )

  • 5/27/2018 Preda Vanja

    365/467

    , 37

    )

    16

    (Exterior gateways)

    ,

    (Three Autonomous

    Systems)

    EGP IGP

    AutonomousSystem 1

  • 5/27/2018 Preda Vanja

    366/467

    , 38

    IGP AutonomousSystem 2

    IGPAutonomous

    System 3

    EGP- Exterior Gateway ProtocolsIGP Interior Gateway Protocols

    Intra-AS and Inter-AS Routing

    Hosth2

    A.a

    C.b

    B.a

    Inter-AS routingbetween A and B

  • 5/27/2018 Preda Vanja

    367/467

    , 39

    h2

    a

    b

    b

    a

    aC

    A

    B

    dc

    A.c c

    b

    Hosth1

    Intra-AS routingwithin AS A

    Intra-AS routingwithin AS B

    IGP versus EGP

    Interior Gateway Protocols (IGP) Intra-domainProtocols (

    ) .

    () .

  • 5/27/2018 Preda Vanja

    368/467

    , 40

    Exterior Gateway Protocols (EGP) Inter-domainprotocols ( )

    ( )

  • 5/27/2018 Preda Vanja

    369/467

    , 41

    (.)

  • 5/27/2018 Preda Vanja

    370/467

    , 42

    ( )

    ()

    (.)

  • 5/27/2018 Preda Vanja

    371/467

    , 43

    ,

    (AS).

  • 5/27/2018 Preda Vanja

    372/467

    , 44

    (.)

    TCP

  • 5/27/2018 Preda Vanja

    373/467

    , 45

  • 5/27/2018 Preda Vanja

    374/467

    8

    RIP, OSPF

    RIP

  • 5/27/2018 Preda Vanja

    375/467

    OSPF

    RIP, OSPF 2

    ( )

  • 5/27/2018 Preda Vanja

    376/467

    ( ) ( )

    , .

    a () .

    RIP, OSPF 3

  • 5/27/2018 Preda Vanja

    377/467

    RIP, OSPF 4

    R3 R4

    R1 R2

    0

    0

    1

    1

    22

    5

    5

    33

    0

    0R3 R4

    R1 R2

    1

    32

    5

    RIP (Routing Information Protocol)

    /

  • 5/27/2018 Preda Vanja

    378/467

    /

    ( )

    RIP, OSPF 5

    ?

    ()

  • 5/27/2018 Preda Vanja

    379/467

    0

    a ()

    RIP, OSPF 6

    RIP

  • 5/27/2018 Preda Vanja

    380/467

    1( )

    ( )

    RIP, OSPF 7

    -

  • 5/27/2018 Preda Vanja

    381/467

    0

    RIP, OSPF 8

  • 5/27/2018 Preda Vanja

    382/467

    ( )

    ,

    RIP, OSPF 99

  • 5/27/2018 Preda Vanja

    383/467

    RIP, OSPF 10

    ,

    Dest. NH Cost

    A loc. 0

    A

    Dest. NH Cost

    B loc. 0

    BA = 0

    Dest.=destinationNH = Next Hop

    1

  • 5/27/2018 Preda Vanja

    384/467

    RIP, OSPF 11

    Dest. NH Cost

    C loc. 0CDest. NH Cost

    D loc. 0D

    Dest. NH Cost

    E loc. 0

    E

    Loc.= Cost =

    Dest. NH Cost

    A loc. 0

    B B 1

    D D 1

    Dest. NH Cost

    B loc. 0

    A A 1

    C C 1

    E E 1

  • 5/27/2018 Preda Vanja

    385/467

    RIP, OSPF 12

    D

    A = 0, B=1, D=1

    E

    Dest. NH Cost

    D loc. 0

    A A 1

    E E 1

    C

    A B

    - Dest. NH Cost

    A loc. 0

    B B 1

    D D 1

    C B 2

    E B 2

    Dest. NH Cost

    B loc. 0

    A A 1

    D D 2

    C C 1

    E E 1

    Dest. NH Cost

    C loc. 0

    B B 1

    A B 2

    E E 1

    D E 2

  • 5/27/2018 Preda Vanja

    386/467

    RIP, OSPF 13

    A BDest. NH Cost

    D loc. 0

    A A 1

    B A 2

    E E 1

    C E 2

    D

    C

    D E 2

    Dest. NH Cost

    E loc. 0

    B B 1

    A B 2

    D D 1

    C C 1

    E

    a

    a

    Dest. NH Cost

    A loc. 0

    B B inf.

    D D 1

    C B i f

    Dest. NH Cost

    B loc. 0

    A A inf

    D A inf

  • 5/27/2018 Preda Vanja

    387/467

    RIP, OSPF 14

    A

    C B inf.

    E B inf.C C 1

    E E 1

    B

    D

    B = 0, A = inf., D = inf. , C = 1, E = 1A = 0, B = inf., D = 1 , C = inf., E = inf.

    inf. =

    - a Dest. NH Cost

    A loc. 0

    B B inf.D D 1

    C B inf.

    E B inf.

    Dest. NH Cost

    B loc. 0

    A A inf

    D A inf

    C C 1

    E A 1

    Dest. NH Cost

    C loc. 0

    B B 1A B inf

    E E 1

    D E 2

  • 5/27/2018 Preda Vanja

    388/467

    RIP, OSPF 15

    A

    E A 1

    B C

    Dest. NH Cost

    D loc. 0

    A A 1

    B A inf.

    E E 1

    C E 2

    D

    Dest. NH Cost

    E loc. 0

    B B 1

    A B inf

    D E 1

    C C 1

    E

    D=0, A=1, B=inf., E=1, C=2

    E=0, B=1, A=inf., D=1, C=1

    C=0, B=1, A=inf. , E=1, D=2

    Dest. NH Cost

    A loc. 0

    B B inf.

    D D 1

    C D 3

    E D 2

    Dest. NH Cost

    B loc. 0

    A A inf

    D E 2

    C C 1

    E E 1

    Dest. NH Cost

    C loc. 0

    B B 1

    A B inf

    E E 1

    - a

  • 5/27/2018 Preda Vanja

    389/467

    RIP, OSPF 16

    A

    E D 2 E E 1

    B

    E E 1

    D E 2

    C

    Dest. NH Cost

    D loc. 0

    A A 1

    B E 2

    E E 1

    C E 2

    D

    Dest. NH Cost

    E loc. 0

    B B 1

    A D 2

    D D 1

    C C 1

    E

    D=0, A=1, B=2., E=1, C=2

    E=0, B=1, A=2., D=1, C=1

    Dest. NH Cost

    A loc. 0

    B D 3

    D D 1

    C D 3

    E D 2

    Dest. NH Cost

    B loc. 0

    A E 3

    D E 2

    C C 1

    Dest. NH Cost

    C loc. 0

    B B 1

    A E 3

    E E 1

    - a

  • 5/27/2018 Preda Vanja

    390/467

    RIP, OSPF 17

    E D 2E E 1 D E 2

    Dest. NH Cost

    D loc. 0

    A A 1

    B E 2

    E E 1

    C E 2

    Dest. NH Cost

    E loc. 0

    B B 1

    A D 2D D 1

    C C 1

  • 5/27/2018 Preda Vanja

    391/467

    RIP, OSPF 18

    (). Counting-to-infinity problem (

    )

    Bouncing effect ( )

    Counting to Infinity

    f

    : D

    E

    A B

    C

    D

    Dest. NH Cost

    A loc. 0

    B D 3

    D D 1

  • 5/27/2018 Preda Vanja

    392/467

    RIP, OSPF 19

    D A

    A Do.

    A o D -

    counting to infinity.

    Dest. NH Cost

    D loc. 0

    A A 1

    B E inf.

    E E inf.

    C E inf.

    D

    C D 3

    E D 2

    A

    Counting to Infinity (.)

    Dest. NH Cost

    A loc. 0

    B D 3

    D D 1

    C D 3

    () B,

    CE A, D

  • 5/27/2018 Preda Vanja

    393/467

    RIP, OSPF 20

    Dest. NH Cost

    D loc. 0

    A A 1

    B A 4

    E A 3

    C A 4 D

    C D 3

    E D 2

    A

    DA TTL=0.

    c AD.

    Counting to Infinity (.)Dest. Link Cost

    A loc. 0

    B D 5

    D D 1

    C D 5

    E

    A D

    .

    1.

  • 5/27/2018 Preda Vanja

    394/467

    RIP, OSPF 21

    Dest. Link Cost

    D loc. 0

    A A 1

    B A 4

    E A 3

    C A 4

    D

    E D 4

    A

    .

    .

    Dest. Link Cost

    A loc. 0B D Inf.

    D D 1

    C D Inf.

    ,

    (

  • 5/27/2018 Preda Vanja

    395/467

    RIP, OSPF 22

    Dest. Link Cost

    D loc. 0

    A A 1

    B E Inf.

    E E Inf.

    C E Inf.

    D

    E D Inf.

    A

    D , . .

    )

    Bouncing Effect e 10 1.

    b .Dest. NH Cost

    A loc. 0

    B B 1

    D D 1

    Dest. NH Cost

    B loc. 0

    A A 1

    D A 2

    C C 1

    Dest. NH Cost

    C loc. 0

    B B 1

    A B 2

    B A

    inf.

    i f

    inf

    inf.

  • 5/27/2018 Preda Vanja

    396/467

    RIP, OSPF 23

    A

    C B 2

    E B 2

    C C 1

    E E 1

    B

    Dest. NH Cost

    D loc. 0

    A A 1

    B A 2

    E E 1

    C A 3

    D

    C

    E B 2

    D B 3

    Dest. NH Cost

    E loc. 0

    B B 1

    A B 2

    D D 1

    C B 2

    E

    , A

    B.

    inf.

    inf.

    f

    B AE.

    AE .

    Dest. NH Cost

    A loc. 0

    B B 1

    D D 1

    C B 4

    Dest. NH Cost

    B loc. 0

    A A 1

    D A 2

    Dest. NH Cost

    C loc. 0

    B B inf

    A B inf

    C AB

    Bouncing Effect (.)

  • 5/27/2018 Preda Vanja

    397/467

    RIP, OSPF 24

    a

    cd

    e (10)

    f

    A

    C B 4

    E B 2C A 3

    E E 1

    B

    Dest. NH Cost

    D loc. 0

    A A 1

    B A 2

    E E 1

    C A 3

    D

    E B inf

    D B inf

    Dest. NH Cost

    E loc. 0

    B B 1

    A B 2

    D D 1

    C B 4

    E

    C 10 .

    E 1 11 > 4( )

  • 5/27/2018 Preda Vanja

    398/467

    RIP, OSPF 25

    AE

    BD, C 5.

    E C 11.

    C e, .

    ?

    Count to Infinity

  • 5/27/2018 Preda Vanja

    399/467

    RIP, OSPF 26

    ( )

    ouncing effect

    () 1

    - Split Horizon

    ( )

    :

    .

  • 5/27/2018 Preda Vanja

    400/467

    RIP, OSPF 27

    Split horizon

    Split horizon

    : , ( )

    : , (split horizon with poison reverse)

    Split Horizon -

    Dest. NH Cost

    B l 0

    B

    Dest. NH Cost

    C loc 0

    C

    Dest. NH Cost

    A loc. 0

    A

    A=0 C=0

    B=0, C=1 B=0, A=1

  • 5/27/2018 Preda Vanja

    401/467

    RIP, OSPF 28

    B loc. 0

    A A 1

    C C 1

    C loc. 0

    B B 1

    A B 2

    B B 1

    C B 2

    B-C ,

    .

    count-to-infinity.

    Split Horizon

    Split horizon

  • 5/27/2018 Preda Vanja

    402/467

    RIP, OSPF 29

    3 .

    C

    BA

    A l 0

    A:B 2

    B: B 1

    C: loc. 0

    D: D 1

    A B 2

  • 5/27/2018 Preda Vanja

    403/467

    RIP, OSPF 30

    D

    A: loc. 0

    B: B 1

    C: B 2D: B 2

    A: A 1

    B: loc. 0

    C: C 1

    D: D 1

    A: B 2

    B: B 1

    C: C 1D: loc. 0

    (.)

    C

    BA

    A l 0 A=2,C=0,B=

    1

    =2,D=0,B=1

    A: B 2

    B: B 1

    C: loc. 0D: D 1

  • 5/27/2018 Preda Vanja

    404/467

    RIP, OSPF 31

    D

    A: loc. 0

    A: A infB: loc. 0

    C: C 1

    D: D 1

    A

    A: C 3

    B: B 1

    C: C 1

    D: loc. 0

    A=

    ,

    D. D ,

    updates .

    (.)

    C

    BA

    A l 0 A=2,C=0,B=

    1

    =2,D=0,B=1

    A: B 2

    B: B 1

    C: loc. 0D: D 1

  • 5/27/2018 Preda Vanja

    405/467

    RIP, OSPF 32

    D

    A: loc. 0

    A: D 4B: loc. 0

    C: C 1

    D: D 1

    A

    A: C 3

    B: B 1

    C: C 1

    D: loc. 0

    A=

    .

    Hold-down Timers

    , (holddown timer) .

  • 5/27/2018 Preda Vanja

    406/467

    RIP, OSPF 33

    .

    Triggered Updates

  • 5/27/2018 Preda Vanja

    407/467

    RIP, OSPF 34

    ( )

    RIP

    1960-:

    ARPANET

    1970-: XNS (Xerox Network System) RIP

  • 5/27/2018 Preda Vanja

    408/467

    RIP, OSPF 35

    RIP

    1982: routed BSD Unix ( RIP)

    1988: RIPv1 (RFC 1058) -

    1993: RIPv2 (RFC 1388)

    1998: RIPv2 (RFC 2453)

    RIP - (

    1)

    16 ( 15)

    point-to-point broadcast

    IP

  • 5/27/2018 Preda Vanja

    409/467

    RIP, OSPF 36

    IP

    30

    Hold down timer e 180 sec.

    UDP