QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1272|回复: 8

好多疑惑不解的问题

[复制链接]
发表于 2003-5-27 22:42:39 | 显示全部楼层 |阅读模式
我在阅读linux网络部分的源代码的时候有一些问题不明白,请大虾指点。
1) 客户服务器的模式下,客户最早什么时候可以开始发送http请求?就是说,1、客户是在他的连接请求一进入"accept_queue"(也就是三次握手刚完成)就可以发送数据,还是2、客户需要等到他的连接请求被服务器端用accept函数从accept_queue取出之后才可以发送数据。

2)在客户端发送第三次握手的ack包以后,服务器端收到后是不是将该客户的连接请求从未完成连接队列转移到accept_queue,并且将随机生成的数据端口返回
给客户。从而这时客户可以发送数据。

3)服务器开了监听端口,如果有很多客户同时连接,服务器是不是为每个连接都在收到第一次的握手包(syn)的时候创建一个socket,并选择一个随机的端口进行和客户进行数据通信。   

4)linux中的listenqueue是指已完成连接队列还是未完成连接队列。

多谢大虾指点,不胜感激
发表于 2003-5-27 23:04:08 | 显示全部楼层
1) tcp/ip protocol problem, any tcp/ip book can solve u question. i think is 2)
2) i think it is right
3) yes,
4) the second one.

but my answer probably not right. i do not touch tcp/ip protocol for 3 years. that is also why i can not answer the ipv6 problem in another post.
回复

使用道具 举报

发表于 2003-5-28 08:13:55 | 显示全部楼层
建议参考stenves的《TCP/IP祥解》第二卷
回复

使用道具 举报

发表于 2003-5-28 09:00:00 | 显示全部楼层
yes, this is more like a tcp/ip course test.
回复

使用道具 举报

 楼主| 发表于 2003-6-1 00:35:27 | 显示全部楼层
但是,如果和每個客戶通信都選擇一個隨機的端口,那要是有大量客戶連接(比如說一個
web server),豈不是要開很多端口。但是,我用netstat怎麽看不到呢?  謝謝

另外,想問一下這個論壇有沒有郵件通知功能
回复

使用道具 举报

 楼主| 发表于 2003-6-1 00:38:24 | 显示全部楼层
By the way,  these questions are not course tests. I'm doing the research of Wireless Web QoS, and I want to test my algorithm on linux kernel.
And thanks very much for your help.
回复

使用道具 举报

发表于 2003-6-1 05:53:11 | 显示全部楼层
'发贴时提醒我' is this what u want?

yes, will have many connections. but for web server, many are short time connections.

wireless web qos? interesting topic.
回复

使用道具 举报

发表于 2003-6-3 19:39:59 | 显示全部楼层
好久没有看网络代码了。只能说是我的理解吧
1)我们发送数据都是在accept创建新的socket之上,所以答案是后者。udp似乎不同了。
2)ack是否在三次握手之后的问题,其实在实现中如果accept调用返回就可以认为三次握手已经完成,所以可以这样认为。
3)我认为应该是在三次握手完成之后建立socket,但TCP会建立TCP块处理三次握手,存在synflooding也就是这些半连接存在。????socket是指什么?struct sock or struct socket?好像很复杂,不能肯定。
4)listenquene是指未完成的连接队列。
回复

使用道具 举报

发表于 2003-6-4 10:06:58 | 显示全部楼层
i guess the socket he means is the concept we use in user space ,not the kernel structure.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-29 06:47 , Processed in 0.046385 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表