Stanford CS144 Introduction to Computer Networking 学习笔记(一)

Introduction to Computer Networking

1.1 A day in the life of an application

Common communication model of networked applications: a bidirectional, reliable byte stream

  • client-server model: World Wide Web(using HTTP)
  • peer-to-peer model: BitTorrent
  • skype: rendezvous or relay server

1.2 The 4 layer Internet model

Link: packet is called frame

Network: packet is called datagram, 如果使用Internet,network层必须使用IP

Transport: packet is called segment

Application

每一层只和对应的层交流,通过调用对下一层的API来利用下一层的服务,socket就是应用层对运输层的API
这里写图片描述

a packet has two types of fields: header fields and a payload field. The payload is typically a packet from the layer above.

a hop is a link between two routers

1.3 The IP Service Model

IP提供哪些服务?

基本服务:

  • Datagram: 接受来自Transport层的segment作为datagram的data,将datagram作为Link层的data传给Link层
  • Unreliable: 不保证按照顺序、一定到达、duplicate packet,而且发生这些错误也不会报告
  • Best-effort
  • Connectionless: 每个datagram之间是独立的,互相不知道的;IP service model doesn’t contain a flow state that records the whole communication (it only cares about destination) in its network

更多服务:

  • 防止loop,通过datagram header中的time to live(TTL)阻止
  • 如果Link层允许的packet大小小于datagram的,router可以fragment datagram
  • 减小送错datagram的几率,通过datagram header中的checksum
  • 允许新的IP版本:ipv4,ipv6
  • 允许向datagram header中添加新的field从而添加新的feature

为什么如此设计IP?

  • end-to-end principle:能在end host上加的feature,就不在network中加
  • reliable和unreliable的服务都可以建在Network层上
  • IP可以建在任何Link层上:IP makes very few assumptions about the link layer below
  • 简单的IP快速、便宜,可以用dedicated hardware实现

1.4 A Day in the Life of a Packet

传输packet的过程:
这里写图片描述

Network layer is responsible for delivering packets to computers

Transport layer is responsible for delivering packets to applications

  • Tools

    • Wireshark

    • traceroute -w 1 网址

    -w 1指明wait for reply的timeout为1s

    Traceroute is a software program that displays the connection (path) through the Internet between this traceroute server and the location you enter above. The Internet path between the two locations has many routers, computers and other devices along it which help move your information. Each device along this path looks at your request and then sends it off to the next device until it reaches its destination. The Traceroute program shows the amount of time each device on the route takes to do three things: (1) receive the traceroute request (ICMP), (2) process that request and (3) send it back. Traceroute performs this test three times on each device (each device is called a “hop”).

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值