首页 > Web开发 > 详细

cs244a-Introduction to Computer Networking-Unit2

时间:2019-11-18 19:37:09      阅读:60      评论:0      收藏:0      [点我收藏+]

Unit2

学习目标:

  1. how TCP set up a connection
  2. what TCP segment looks like
  3. how can TCP be in high performance
  4. detect errors
  5. Finite State Machine, a basic tools and approach to network protocol design

2.1 The TCP service model

  1. Transmission Control Protocol(TCP)
    • connection:
      • two-way communication channel
      1. A -> B
      2. B -> A
    • at both ends of the connection, TCP keeps a state machine to keep track of how the connection is doing
  2. Connection setup: 3-way hadnshake
    1. SYN:
      • 方向:A向B
      • A request conn with B
    2. SYN + ACK:
      • 方向:B向A
      • SYN:B request conn with A
      • ACK: B agree to conn with A
    3. ACK:
      • 方向:A向B
      • A agree to conn with B
  3. Data trasmission
    • stream of bytes service
    • using TCP segments
      • SSH一次segment只有1个byte
  4. Connection teardown
    • closing the connection and both ends can clean up the state associated with the state machine
    1. FIN:
      • 方向:A向B
    2. (Data+) ACK:
      • 方向:B向A
    3. FIN:
      • 方向:B向A
    4. ACK:
      • 方向:A向B
  5. The TCP service model

    Property Behavior
    Stream of bytes Reliable delivery service
    Reliable delivery:
    4 mechanism for reliability
    1. Acknowledgments indicate correct delivery
    2. Checksums detect corrupted data
    3. Sequence numbers detect missing data
    4. Flow-control prevents overrunning receiver
    In-sequence Data delivered to application in sequence transmitted.
    Congestion Control Controls network congestions
  6. The TCP Segment Format
    技术分享图片
  7. The Unique ID of the TCP connection
    • 104-bit globally unique ID(Internet wide)
      • IP:
        1. IP Dest Addr
        2. IP Src Addr
        3. Protocol ID
      • TCP:
        1. Dest Port
        2. Src Port
    • Host A increments source port for every new connection: unique source port number(16bits)
    • TCP picks random ISN(Initial Sequence Number) to avoid overlap with previous connection with same ID
  8. Sequence Numbers
    • ISN(initial sequence number): 表明发送的第一个字节的序列号
    • Ack sequence number:
      1. 表明下一个期待的字节的序列号
      2. 表明已经接受到的字节数
  9. Summary
    • TCP provides in-order, reliable delivery of a stream of bytes between application processes.

cs244a-Introduction to Computer Networking-Unit2

原文:https://www.cnblogs.com/Willendless/p/11884355.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!