没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
2019 年 TCP/IP 习题答案和复习课提要
1
403 工作室 @铮哥牛逼
Key point
试卷题型:填空题(12 空)、判断题 5 题、简答题 5 题、综合题 3 题(其中一个是程序注释题)
有几个知识点提醒大家掌握:
1. socket 实现 (掌握会调用哪些函数分别创建以下哪个结构:file、socket、inpcb、tcpcb 等)(课堂练习)
falloc(15.6)、socreate、in_pcballoc(22.1)、tcp_newtcpcb(25.8)
2. udp_input 和 udp_output 函数
3. 满足哪些条件才会发送 ICMP 重定向报文
首先,只有在同一接口( r t_ i f p 和 r c v i f)上接收或重发分组时,才能应用重定向。
其次,被选择的路由本身必须没有被 I C M P 重定向报文创建或修改过 (R T F _ D Y N A M I C | R T F _ M O
D I F I E D)
而且该路由也不能是到默认目的地的( 0 . 0 . 0 . 0 )
全局整数 i p s e n d r e d i r e c t s 指定系统是否被授权发送重定向.
当传给 i p _ f o r w a r d 的参数 s r c r t 指明系统是对分组路由选择的源时,禁止系统重定向
First, redirects are applicable only when a packet is received and resent on the same interface (rt_ifp
and rcvif).
Next, the selected route must not have been itself created or modified by an ICMP redirect message
(RTF_DYNAMIC | RTF_MODIFIED).
Third, the route cannot be to the default destination (0.0.0.0).
Forth, system need to have administrative authority to send redirects, which means the global integer
ipsendredirects is 1.
Five, redirects are not suppressed when the system is source routing a packet as indicated by the srcrt
argument passed to ip_forward, which means the srcrt argument is False.
4. 理解图 24.17 和图 24.18,理解 TCP 的流量控制机制和收发窗口如何滑动,理解每个序号变量的含义
5. 在 IP 处理过程中可能会发生哪些差错,并发送哪些 icmp 差错报文 (作业中有,需要查看 ch8 ch10 中的代
码)
1、If ip_ttl has reached 1 (IPTTLDEC), an ICMP time exceeded message is returned to the sender and
the packet is discarded. Otherwise, ip_forward decrements ip_ttl by IPTTLDEC.
2、If no route can be found for the destination, an ICMP host unreachable error is returned and the
packed discarded.
3、If fragmentation is prohibited by the DF bit, ip_output discards the packet and returns
EMSGSIZE. If the datagram was generated on this host, a transport protocol passes the error back to the
process, but if the datagram is being forwarded, ip_forward generates an ICMP destination unreachable
error with an indication that the packet could not be forwarded without fragmentation
P221
4、an ICMP time exceeded error be sent to the source host if the timer expires and the first
fragment of the datagram has been received. P232
2019 年 TCP/IP 习题答案和复习课提要
2
403 工作室 @铮哥牛逼
复习课
Chapter1
Net3 代码的组织层次
Chapter2
1、mbuf 结构体的字段和其含义
2、mdevget()函数:创建 mbuf 链表,根据数据大小四种情况
3、mget()函数,P32,分配 mbuf
4、mbuf 放分组的标志: M_PKTHDR
Chapter3
1、ifnet:通用接口结构
2、ifaddr:通用地址结构
3、le_softc :以太网的专用接口结构,arpcom :通用以太网结构
4、P61, main 函数,cpustartup 的功能
Chapter4
1、P82,ether_input()函数 ,作用,读懂
2、P84,ether_output()函数:验证、特定协议处理、构造帧、接口排队。调用 arpresolve 获得下一跳硬件地址
P85 line93,成功的话跳到 P87,放到发送缓存发送。不成功 return
Chapter6
P128 struct in_ifaddr 干什么的,是 ip 协议专用地址结构
P126 图 全局变量 in_ifaddr 指向全部 ip 地址,ifnet_addrs 指向数据链路层地址(MAC)
数据链路层地址:ifaddr+2 个 sockaddrdl?(没听清)
P128 图 6-8、6-9 看懂
Chapter7
P153 domaininit()作用
P158 ip_protox 数组是干嘛的、ipinit()函数作用
加框题目:复习课提到
加问号答案:不清楚,找不到明确答案
2019 年 TCP/IP 习题答案和复习课提要
3
403 工作室 @铮哥牛逼
Chapter 1. Introduction
6. Which communication protocol families do 4.4BSD support?
1、TCP/IP
2、XNS (Xerox Network Systems)
3、The OSI protocols
4、The Unix domain protocols.
7. Two popular application programming interfaces (APIs) for writing programs to use the Internet protocols are socket
and TLI (Transport Layer Interface).
8. The networking code in the 4.4BSD kernel is organized into three layers: socket layer, protocol layer, interface
layer. The interface layer contains the device drivers that communicate with the network devices.
9. Data structures that are created by the kernel when the process calls socket are: filedesc, socket, vnode.
10. The return value from socket is a descriptor. The socket system calls start with a descriptor. Please describe how a
descriptor leads to a socket structure.
When the process executes a system call,
the kernel starts with the descriptor value and
uses “fd_ofiles” to index into the vector of “file”
structure pointers, ending up with the “file”
structure for the descriptor. The “file”
structure points to “socket” structure.
11. When a UDP datagram(数据包) arrives on a
network interface, how does the kernel find the
corresponding socket structure?
The kernel searches through all the UDP
protocol control blocks to find the appropriate
one, minimally based on the destination UDP
port number and perhaps the destination IP
address, source IP address, and source port
numbers too. Once the inpcb structure is
located, the kernel finds the corresponding
socket structure through the inp_socket
pointer
12. In the call to sendto, the fifth argument points to
an Internet socket address structure (named serv) and the sixth argument specifies its length (which is 16 bytes). One
of the first things done by the socket layer for this system call is to verify that these arguments are valid (i.e., the
pointer points to a piece of memory in the address space of the process) and then copy the socket address structure
into an mbuf. What is the m_type member of the resulting mbuf ? or What is the m_type member of the mbuf
containing socket address structure?
The “m_type” member specifies the type of data contained in the mbuf, which for this example is
MT_SONAME, name of the socket.
13. What is the protocol layer corresponding to a UDP socket descriptor?
剩余12页未读,继续阅读
郑华滨
- 粉丝: 25
- 资源: 296
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Javascript和Python的微商城项目设计源码 - MicroMall
- 基于Java的网上订餐系统设计源码 - online ordering system
- 基于Javascript的超级美眉网络资源管理应用模块设计源码
- 基于Typescript和PHP的编程知识储备库设计源码 - study-php
- Screenshot_2024-05-28-11-40-58-177_com.tencent.mm.jpg
- 基于Dart的Flutter小提琴调音器APP设计源码 - violinhelper
- 基于JavaScript和CSS的随寻订购网页设计源码 - web-order
- 基于MATLAB的声纹识别系统设计源码 - VoiceprintRecognition
- 基于Java的微服务插件集合设计源码 - wsy-plugins
- 基于Vue和微信小程序的监理日志系统设计源码 - supervisionLog
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0