Why Internet working?

  1. To build a “network of networks” or internet.
  2. operating over multiple, coexisting(共存的), different networks
  3. providing ubiquitous(无处不在的) connectivity through IP packet transfer .
  4. achieving huge economies of scale.

TCP/IP Protocol Suite

Encapsulation(封装)

  • Base:HTTP Request ->TCP header->IP header->Ethernet header

Internet Addresses

  • Each host has globally unique logical IP address
  • Separate address for each physical connection to a network
  • Routing decision is done based on destination IP address
  • IP address has two parts:
  1. netid(网络标识符) and hostid
  2. netid unique, facilitates routing
  • Dotted Decimal(十进制) Notation(记号):
    int1.int2.int3.int4
    (intj = jth octet)
    128.100.10.13

Internet Protocol

  1. Provides best effort, connectionless packet delivery
  • motivated by need to keep routers simple and by adaptibility to failure of network elements
  • packets may be lost, out of order, or even duplicated(复制)
  • higher layer protocols must deal with these, if necessary
  1. IP also includes:
  • Internet Control Message Protocol (ICMP)
  • Internet Group Management Protocol (IGMP)

IP Packet Header

  1. Minimum 20 bytes
  • Up to 40 bytes in options fields
  1. Version: current IP version is 4.
  2. Internet header length (IHL): length of the header in 32-bit words.
  3. Type of service (TOS): traditionally priority of packet at each router. Recent Differentiated Services redefines TOS field to include other services besides best effort.
  4. Total length: number of bytes of the IP packet including header and data
  5. Identification, Flags, and Fragment Offset: for fragmentation and reassembly.
  6. Time to live (TTL): number of hops packet is allowed to traverse(穿过) in network.
  • Each router along the path to the destination decrements this value by one.
  • If the value reaches zero before the packet reaches the destination, the router discards the packet and sends an error message back to the source.
  1. Protocol: specifies upper-layer protocol that is to receive IP data at the destination. Examples include TCP (protocol = 6), UDP (protocol = 17), and ICMP (protocol = 1).
  2. Header checksum(校验和): verifies the integrity of the IP header.
  3. Source IP address and destination IP address: contain the addresses of the source and destination hosts.
  4. Options: Variable length field, allows packet to request special features such as security level, route to be taken by the packet, and timestamp at each router. Detailed descriptions of these options can be found in [RFC 791].
  5. Padding: This field is used to make the header a multiple of 32-bit words.

IP Header Processing

  1. Compute header checksum(校验和) for correctness and check that fields in header (e.g. version and total length) contain valid values
  2. Consult routing table to determine next hop
  3. Change fields that require updating (TTL, header checksum)

TCP-IP Architecture and IP Packet的更多相关文章

  1. TCP/IP——内外网IP+子网掩码作用+PING(网络总结)

    目录: 1.如何区分内网IP和外网IP? 保留字段 2.子网掩码是起什么作用的? 将DNS和IP异或,表示哪段起作用 3.ping到底起什么作用? ping本地.ping远程 下面针对上面三个问题分别 ...

  2. TCP/IP 协议:IP 协议

    首先来看一下IP协议在实际中的位置: 我们只关系流程,不关系当前具体的服务类型 1.IP协议概述 作用: 从上图或从应用层->运输层->网络层->链路层来看,IP协议属于网络层,也就 ...

  3. TCP/IP笔记(四)IP协议

    前言 IP相当于OSI参考模型的第3层--网络层:主要作用是"实现终端节点之间的通信"又称"点对点通信". IP作为整个TCP/IP中至关重要的协议,主要负责将 ...

  4. TCP/IP笔记(五)IP协议相关技术

    IP旨在让最终目标主机收到数据包,但是在这一过程中仅仅有IP时无法实现通信的.必须还要又能够解析主机名称和MACdivide功能,以技术包在发送过程中异常情况处理的功能. 这篇主要介绍下DNS.ARP ...

  5. TCP/IP协议栈 --- 网络层(IP 首部 和分片)

    IP 是TCP/IP协议栈中重要的层次, TCP UDP ICMP IGMP都是依赖IP层进行传输的.首先它是一种不可靠,无连接的协议.不可靠:它不保证IP包能正确到达目的地,无连接:表示IP并不会维 ...

  6. tcp、udp、ip、icmp报文格式分析

    TCP .UDP .IP. ICMP协议报文格式分析 Tcp报文格式: Wireshark抓包如图: 源端口/目的端口(16bit): 在TCP报文中包涵了源端口/目的端口,源端口标识了发送进程,目的 ...

  7. TCP/IP协议族——IP工作原理及实例具体解释(上)

     IP协议具体解释 本文主要介绍了IP服务特点,头部结构,IP分片知识,并用tcpdump抓取数据包.来观察IP数据报传送过程中IP的格式,以及分片的过程. IP头部信息:IP头部信息出如今每一个 ...

  8. 常见协议TCP、UDP、IP图

    ip tcp udp icmp help ip tcp http icmp

  9. tcp/iP协议族——IP工作原理及实例具体解释(下)

     IP协议具体解释 上一篇文章文章主要介绍了IP服务的特点,IPv4头部结构IP分片.并用tcpdump抓取数据包,来观察IP数据报传送过程中IP的格式,以及分片的过程.本文主要介绍IP路由,IP ...

随机推荐

  1. Python基础学习总结(七)

    9.类 面对对象编程Object Oriented Programming,简称OOP. 面向对象编程是最有效的软件编写方法之一.在面向对象编程中,你编写表示现实世界中的事物和情景的类,并基于这些类来 ...

  2. python模块之contexlib

    一.上下文管理器 with是python实现上下文管理器的核心关键词.它能够在代码执行前和执行后做一些额外的事情. 最常见的代码恐怕就是文件操作了. with open("file" ...

  3. 图片大于div时的居中显示

    当图片大于div时,想要图片居中显示,如果图片等比例缩小可能会导致图片不能填充整个div,如果直接将图片不设置宽高,将其外层div设置overflow:hidden:这时即使外层div设置了水平垂直居 ...

  4. WPF 蒙罩层 LoadingPage

    WPF 蒙罩层 LoadingPage 前言 无论是在PC客户端,移动端,网站,在遇到长时间处理的时候都会需要用到蒙罩层,让用户有更好的体现.今天上网逛了一下各位前辈网友的蒙罩层的实现方式,觉得有很多 ...

  5. MySQL主从复制与读写分离概念及架构分析

    1.MySQL主从复制入门 首先,我们看一个图: 影响MySQL-A数据库的操作,在数据库执行后,都会写入本地的日志系统A中. 假设,实时的将变化了的日志系统中的数据库事件操作,在MYSQL-A的33 ...

  6. 04_ActiveMQ事务与三种签收方式

    [ActiveMQ添加事务] 添加事务主要注意两点: 1.修改Session配置,启用事务 /** * 3.通过Connection对象创建Session会话(上下文环境对象),用于接收消息. * 参 ...

  7. C++11标准之右值引用(rvalue reference)

    1.右值引用引入的背景 临时对象的产生和拷贝所带来的效率折损,一直是C++所为人诟病的问题.但是C++标准允许编译器对于临时对象的产生具有完全的自由度,从而发展出了Copy Elision.RVO(包 ...

  8. 【Leetcode】【Medium】Flatten Binary Tree to Linked List

    Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6 T ...

  9. js 获取 网页屏幕高度 窗口高度 元素高度 滚动高度

    常用: JS 获取浏览器窗口大小 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // 获取窗口宽度 if (window.innerWidth) winWidth = ...

  10. PHP:通过MVC,实现第三方登录(百度)

    这里,仓鼠将手把手记录下来实现第三方登录的流程,这里以百度为例 百度开发者中心-官方网址:传送门. 所有第三方接口都不支持本地调试,只有真实的项目和服务器才有可能申请成功. 所以申请的资料全部都要填写 ...