[2017年整理]互联网程序设计第1章 TCPIP协议

上传人:油条 文档编号:48560374 上传时间:2018-07-17 格式:PPT 页数:62 大小:7.02MB
返回 下载 相关 举报
[2017年整理]互联网程序设计第1章 TCPIP协议_第1页
第1页 / 共62页
[2017年整理]互联网程序设计第1章 TCPIP协议_第2页
第2页 / 共62页
[2017年整理]互联网程序设计第1章 TCPIP协议_第3页
第3页 / 共62页
[2017年整理]互联网程序设计第1章 TCPIP协议_第4页
第4页 / 共62页
[2017年整理]互联网程序设计第1章 TCPIP协议_第5页
第5页 / 共62页
点击查看更多>>
资源描述

《[2017年整理]互联网程序设计第1章 TCPIP协议》由会员分享,可在线阅读,更多相关《[2017年整理]互联网程序设计第1章 TCPIP协议(62页珍藏版)》请在金锄头文库上搜索。

1、第一章、TCP/IP协议OSI模型与TCP/IP协议栈 网络组成与报文的变换 UDP与TCP协议 Linux编程环境1.TCP/IP协议栈 OSI参考模型ApplicationPresentationSessionTransportNetworkData LinkPhysicalApplicationPresentationSessionTransportNetworkData LinkPhysicalNetworkThe Physical Layern Responsibility: transmission of raw bits over a communication channel.

2、n Issues: l mechanical and electrical interfaces l time per bit l distancesThe Data Link Layer - Data Link Controln Responsibility: lprovide an error-free communication linkn Issues: lframing (dividing data into chunks) header & trailer bits laddressing10110110101101101101010110001001101100010011101

3、1000000110110000001The Network Layern Responsibilities: lpath selection between end-systems (routing). lsubnet flow control. lfragmentation & reassembly ltranslation between different network types.n Issues: lpacket headers lvirtual circuitsThe Transport Layern Responsibilities: lprovides virtual en

4、d-to-end links between peer processes. lend-to-end flow controln Issues: lheaders lerror detection lreliable communicationThe Session Layern Responsibilities: lestablishes, manages, and terminates sessions between applications. lservice location lookupn Many protocol suites do not include a session

5、layer.The Presentation Layern Responsibilities: ldata encryption ldata compression ldata conversionn Many protocol suites do not include a Presentation Layer.The Application Layern Responsibilities: lanything not provided by any of the other layersn Issues: lapplication level protocols lappropriate

6、selection of “type of service”Layering & Headers n Each layer needs to add some control information to the data in order to do its job. n This information is typically prepended to the data before being given to the lower layer.n Once the lower layers deliver the the data and control information - t

7、he peer layer uses the control information.EncapsulationProcessTransportNetworkData LinkProcessTransportNetworkData LinkDATADATADATADATAHHHHHH对等通信TCP/IP协议栈 TCP/IP协议的分层结构应用层表示层会话层传输层网络层数据链路层物理层应用层IPv4, IPv6网络介质层TCPUDPOSI模型TCP/IP模型TCP/IP协议栈总览tcpdumptcpdumpmroutedmroutedpingpingtraceroutetracerouteAppl

8、.Appl.Appl.Appl.Appl.Appl.Appl.Appl.pingpingtraceroutetracerouteTCPTCPUDPUDPICMPICMPIGMPIGMPIPv4IPv4IPv6IPv6ICMPv6ICMPv6BPFBPF DLPIDLPI数据链路数据链路ARPARP RARPRARPIPv4应用程序 AF-INETIPv6应用程序 AF-INET6API数据进入协议栈时的封装用户数据用户数据用户数据用户数据App头部用户数据用户数据TCP头部用户数据用户数据TCP头部IP头部用户数据用户数据TCP头部IP头部以太网 头部以太网 尾部以太网帧401500字节FTP

9、 客户TCPIP以太网驱 动程序TCP段IP分组以太网数据帧分用过程以太网帧ARPRARPIPICMPIGMPTCPUDP应用程序应用程序应用程序应用程序进入的帧根据以太网首部中 的帧类型进行分用根据IP首部中的 协议类型进行分用根据TCP或UDP 首部中的端口号 进行分用2. 网络组成与报文变换 网络是由传输线路、网络设备、各种主机和服务器构成 的一个分布式的系统。网络设备负责将传输线路连接起 来,同时对接收到的分组做相应处理。常见的网络设备 有: repeater中继器 hub集线器 bridge集线器 switch交换机 router路由器 gateway网关Repeatern Copi

10、es bits from one network to another n Does not look at any bits n Allows the extension of a network beyond physical length limitationsREPEATERREPEATERHUB:集线器n n The purpose of a hub, also known as a multi-port The purpose of a hub, also known as a multi-port repeater, is to amplify and re-time netwo

11、rk signals, repeater, is to amplify and re-time network signals, at the bit level, to a large number of users at the bit level, to a large number of users n n Hubs are considered Layer 1 devicesHubs are considered Layer 1 devicesBridgen n Copies frames from one network to anotherCopies frames from o

12、ne network to another n n Can operate selectively - does not copy all Can operate selectively - does not copy all frames (must look at data-link headers).frames (must look at data-link headers). n n Extends the network beyond physical length Extends the network beyond physical length limitations.lim

13、itations.BRIDGEBRIDGESWITCH: 交换机n n The purpose of a switch is to concentrate The purpose of a switch is to concentrate connectivity, while guaranteeing bandwidth. connectivity, while guaranteeing bandwidth. n n You might think of each port on a switch as a micro-You might think of each port on a sw

14、itch as a micro- bridge, which makes it a Layer 2 device.bridge, which makes it a Layer 2 device.Routern Copies packets from one network to another. n Makes decisions about what route a packet should take (looks at network headers).ROUTERROUTERGatewayn Operates as a router n Data conversions above t

15、he network layer. n Conversions: l l encapsulationencapsulation - use an intermediate network l l translation translation - connect different application protocols l l encryption encryption - could be done by a gatewayEncapsulation ExampleGatewayGatewayGatewayGatewayProvides service connectivity eve

16、n though intermediate network does not support protocols.TranslationTranslate from green protocol to brown protocolGatewayGatewayEncryption gatewayEncryption/Decryption GatewaysSecure NetworkSecure NetworkGWGWGWGW?Insecure Network一个局域网的连接例子A Bgoogle报文的变换 假设主机A向google的服务器发起发送一个TCP报文 报文的格式? 经过hub之后,hub的动作是什么?报文发生了变化没 有? 报文接着传递给二层交换机,交换机的动作是什么?报 文的格式发生了什么变化? 二层交换机再将报文传递给路由器,路由器对报文做了 什么处理?3. UDP:用户数据报协议n UDP提供无连接服务 n UDP缺乏可靠性支持,应用程序必须实现

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 电子/通信 > 综合/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号