Upgrade to Pro — share decks privately, control downloads, hide ads and more …

About Transport Layer -layer 4-

About Transport Layer -layer 4-

kkeeth

June 21, 2021
Tweet

More Decks by kkeeth

Other Decks in Technology

Transcript

  1. About Transport Layer


    - layer 4 -
    Jun 21, 2021 YUMEMI Study Group
    kkeeth @kuwahara_jsri @clown0082

    View Slide

  2. About me

    View Slide

  3. const my_info = {


    Name: ‘܂ݪ੟ਔ’,


    Position: ‘Tech Lead of FET’,


    Skills: ‘PHP, Node.js, TS, Ruby’,


    PokemonGO: ‘TL 40’,


    }
    About me

    View Slide

  4. 🙇 Sorry1 … 🙇


    1. This slide is made in English.


    2. I’m really bad at infrastructure


    and networking.


    Plz feedback for me called
    “Masakari” about my talk !!

    View Slide

  5. 🙇 Sorry2 … 🙇


    NAT, NAPT, Window Control
    will be omitted due to lack of time.

    View Slide

  6. 📣 Precondition 📣


    Physical Layer -> Layer 1


    Data-Link Layer -> Layer 2


    Network Layer -> Layer 3


    Transport Layer -> Layer 4

    View Slide

  7. The Role of
    Layer 4

    View Slide

  8. Layer 1:


    Transmission of information to the destination where the


    cable is connected


    Layer 2:


    How data is exchanged within a segment


    → a state in which signals can be exchanged


    Layer 3:


    How data is exchanged between segments(networks)


    → IP address, Routing
    Previously

    View Slide

  9. In other words,


    The role of actually transferring
    data from computer to computer.

    View Slide

  10. The difference between


    Layers 1-3 and 4-7 💁

    View Slide

  11. Layer 4-7
    Differences
    Layer 1-3

    View Slide

  12. Layer 4
    Differences
    Layer 1-3
    Data transfer
    (execution unit)

    View Slide

  13. Layer 4
    Differences
    Layer 1-3
    Not interested


    in these


    ɾData corruption


    ɾDestination does


    not exist


    ɾError occurs

    View Slide

  14. Layer 1-3
    Differences
    All I know is that the packets
    reach the destination
    Layer 4-7

    View Slide

  15. Layer 1-3
    Differences
    Layer 4
    Perform necessary
    processing for transfer
    or received data
    Layer 4-7

    View Slide

  16. About the role of Layer 4 💁

    View Slide

  17. The role of layer 4
    Flow Control
    Error Recovery
    (acknowledgement)
    Identifying
    Applications


    (with Port Number)
    Sequence Number

    View Slide

  18. Error Recovery


    (Acknowledge)

    View Slide

  19. Acknowledgement
    A B
    data
    acknowledgement

    View Slide

  20. Error Recovery
    A B
    data
    ×
    data
    acknowledgement
    re-send

    View Slide

  21. Flow Control

    View Slide

  22. Flow Control
    A B
    send lots of data
    now processing…

    View Slide

  23. Flow Control
    A B
    send lots of data
    I can't keep up
    with the processing,
    over
    fl
    ow💦

    View Slide

  24. Flow Control
    A B
    acknowledgement


    free space: 2

    View Slide

  25. Flow Control
    A B
    acknowledgement


    free space: 0
    ×

    View Slide

  26. Identity Applications


    (with Port Number)

    View Slide

  27. Identifying Applications
    A B
    data
    NIC
    What data is this ?🤔

    View Slide

  28. Identifying Applications
    A B
    data
    NIC
    2000 3000 4000

    View Slide

  29. Identifying Applications
    A B
    data
    NIC
    2000 3000 4000
    Communication between applications


    This is called “end-to-end”

    View Slide

  30. about “Sequence Number”
    later 💁

    View Slide

  31. The role of layer 4
    Flow Control
    Error Recovery
    (acknowledgement)
    Identifying
    Applications


    (with Port Number)
    Segment


    (with Sequence Number)
    Reliable transmission 🤝


    To achieve this, we need …

    View Slide

  32. Two Protocols for Control
    TCP UDP

    View Slide

  33. TCP

    View Slide

  34. Connection, Segment

    View Slide

  35. Connection
    The road of data that is exchanged
    between applications is called a connection.


    The communication path created by TCP


    is called a virtual communication path.

    View Slide

  36. What's the point?🤔

    View Slide

  37. Connection
    To communicate reliably and ef
    fi
    ciently


    To exchange con
    fi
    rmations in advance


    To make sure that others will con
    fi
    rm

    View Slide

  38. Connection
    To communicate reliably and ef
    fi
    ciently


    To exchange con
    fi
    rmations in advance


    To make sure that others will con
    fi
    rm
    This is called


    “Establishing a connection”

    View Slide

  39. A kind of “hello ὸ🤙" protocol
    we often use 😆

    View Slide

  40. TCP Header

    View Slide

  41. TCP Header
    4PVSDFQPSUOVNCFS
    %FTUJOBUJPOQPSUOVNCFS

    4FRVFODFOVNCFS

    "DLOPXMFEHFNFOUOVNCFS

    %BUBP
    ff
    TFU
    3FTFSWF
    $POUSPMCJUT
    XJOEPX

    $IFDLTVN
    &NFSHFODZQPJOUFS

    0QUJPOT
    ※ numbers are bits

    View Slide

  42. TCP Header
    4PVSDFQPSUOVNCFS
    %FTUJOBUJPOQPSUOVNCFS

    4FRVFODFOVNCFS

    "DLOPXMFEHFNFOUOVNCFS

    %BUBP
    ff
    TFU
    3FTFSWF
    $POUSPMCJUT
    XJOEPX

    $IFDLTVN
    &NFSHFODZQPJOUFS

    0QUJPOT
    ※ numbers are bits
    We can remember it as 20 octets 👍

    View Slide

  43. TCP Header
    4PVSDFQPSUOVNCFS
    %FTUJOBUJPOQPSUOVNCFS

    4FRVFODFOVNCFS

    "DLOPXMFEHFNFOUOVNCFS

    %BUBP
    ff
    TFU
    3FTFSWF
    $POUSPMCJUT
    XJOEPX

    $IFDLTVN
    &NFSHFODZQPJOUFS

    0QUJPOT
    ※ numbers are bits

    View Slide

  44. Control bits
    U


    R


    G
    A


    C


    K
    P


    S


    H
    R


    S


    T
    S


    Y


    N
    F


    I


    N

    View Slide

  45. 3 Way Handshake

    View Slide

  46. 3 Way Handshake
    A B
    SYN
    ACK
    SYN + ACK

    View Slide

  47. A kind of “hello ὸ🤙" protocol
    we often use 😆

    View Slide

  48. Connection close
    A B
    FIN + ACK
    ACK
    ACK
    FIN + ACK

    View Slide

  49. MSS

    View Slide

  50. MSS, MTU
    MSS(Max Segment Size)


    MTU(Max Transmission Unit)
    Ethernet
    Header


    (14)
    IP Header


    (20)
    TCP
    Header


    (20)
    Payload


    (TCP Segment)


    (0ʙ1460)
    F


    C


    S


    (4)
    ※ numbers are octets
    MSS
    MTU

    View Slide

  51. Sequence Number

    View Slide

  52. Sequence Number
    MSS(Max Segment Size)


    MTU(Max Transmission Unit)
    Ethernet
    Header


    (14)
    IP Header


    (20)
    TCP
    Header


    (20)
    Payload


    (TCP Segment)


    (0~1460)
    F


    C


    S


    (4)
    ※ numbers are octets
    MSS
    MTU
    If the data is long,


    split it up and send it.

    View Slide

  53. Sequence Number
    MSS(Max Segment Size)


    MTU(Max Transmission Unit)
    Ethernet
    Header


    (14)
    IP Header


    (20)
    TCP
    Header


    (20)
    Payload


    (TCP Segment)


    (0ʙ1460)
    F


    C


    S


    (4)
    ※ numbers are octets
    MSS
    MTU
    The order of the data is important,
    so assign a number to it.


    This number is called Sequence Number.

    View Slide

  54. 3 Way Handshake
    A B
    SYN
    ACK
    SYN + ACK
    MSS


    desicion

    View Slide

  55. Well Known Port

    View Slide

  56. Well Known Port
    A B
    data
    NIC
    2000 3000 4000
    Numbers 1 to 1023 are called
    well known ports.


    * These numbers cannot be
    used.

    View Slide

  57. Well Known Port number
    1PSU
    /VNCFS
    "QQMJDBUJPO
    '51EBUB
    '51DPOUSPM
    5&-/&5
    4.51
    %/4
    %)$1TFSWFS
    %)$1DMJFOU
    1PSU
    /VNCFS
    "QQMJDBUJPO
    5'51
    )551
    101
    4/.1SFRVFTU
    4/.1USBQ
    )5514
    3*1

    View Slide

  58. UDP

    View Slide

  59. TCP
    A B
    SYN
    ACK
    SYN + ACK

    View Slide

  60. UDP
    A B

    View Slide

  61. broadcast(TCP)
    A N
    N
    N
    3 Way Handshake

    View Slide

  62. broadcast(TCP)
    A N
    N
    N
    segment for each destination,


    acknowledgement

    View Slide

  63. broadcast(TCP)
    A N
    N
    N
    segment for each destination,


    acknowledgement
    TCP can't send without knowing the destination,


    so it can't broadcast 😫

    View Slide

  64. broadcast(UDP)
    A N
    N
    N
    Just send a single piece


    of data 👍

    View Slide

  65. broadcast(UDP)
    A N
    N
    N
    Since there is no con
    fi
    rmation,


    it is assumed that high-speed

    View Slide

  66. broadcast(UDP)
    A N
    N
    N
    Real-Time communication, Video distribution,
    Broadcasting application, etc.

    View Slide

  67. UDP
    A B
    Real-Time communication, Video distribution,
    Broadcasting application, etc.

    View Slide

  68. UDP Header

    View Slide

  69. UDP Header
    4PVSDFQPSUOVNCFS
    %FTUJOBUJPOQPSUOVNCFS

    -FOHUI
    $IFDLTVN

    ※ numbers are bits

    View Slide

  70. There are many more, so
    check them out 💁

    View Slide

  71. View Slide