网络
文章平均质量分 82
guoguangwu
这个作者很懒,什么都没留下…
展开
-
netlink套接字
netlink套接字原创 2022-10-08 21:05:37 · 818 阅读 · 0 评论 -
skopeo login error
level=fatal msg="authenticating creds for \"192.168.100.94:1443\": pinging container registry 192.168.100.94:1443: 400 Bad Request"原创 2022-09-15 09:14:24 · 278 阅读 · 0 评论 -
linux 内核 网络设备接口数据结构
1.net_device{}结构网络设备接口使用数据结构net_device,系统中所有网络接口都有一个对应的net_device结构的变量存在。struct net_device{ /* * This is the first field of the "visible" part of this structure * (i.e. as seen by users in the "Space.c" file). It is the name * the interface.原创 2021-07-10 12:28:53 · 628 阅读 · 3 评论 -
linux 网络实现的数据结构-连接
1:bsd socket 工作在bsd socket层用于连接的数据结构是socket{}。对bsd socket来说,传送的数据包类型也有多种。如下表:数据包类型 宏定义 描述 流 SOCK_STREAM 流方式的数据,提供了可靠的双向数据流。主要用在tcp协议中 数据报 SOCK_DGRAM 不可靠的双向数据传输。主要是用在udp协议中 原始数据 SOCK_RAW 进程直接访问底层的协议,从而完成原始的不经过高层协议...原创 2021-07-04 15:29:04 · 280 阅读 · 0 评论 -
linux 网络实现的数据结构-数据包结构
基本数据结构数据包结构1:msghdr{}数据结构struct msghdr {//bsd socket 层中的数据结构 void * msg_name; /* 保存的是这个套接字的名字, 一般都使用NULL初始化 */ int msg_namelen; /* Length of name */ struct iovec * msg_iov; /* 保存的屙屎发送或者接收的数据缓冲区的地址数据,这个结构在下面会介绍 */ __kernel_size_t msg_iovl...原创 2021-07-03 21:55:25 · 515 阅读 · 2 评论 -
linux内核 邻居子系统
基于linux2.4.0分析。数据结构:struct neigh_table{//邻居表结构 struct neigh_table *next;//指向队列中的下一个邻居表 int family;//地址族 int entry_size;//邻居结构的总长度,邻居结构最后要放一个ip地址作为哈希值 int key_len;//ip地址长度 __u32 (*hash)(const void *pkey, const struct net_device *);//哈希函数原创 2021-06-27 18:08:03 · 531 阅读 · 1 评论 -
linux 协议栈 准备连接请求
我们从客户端端socket程序处罚,分析客户端与服务器的连接过程。简单的客户端代码:int main(argc, argv)int argc;char **argv;{ unsigned short port; /* port client will connect to */ char buf[12]; /* data buffer for sending & receiving */ struct ho原创 2021-06-26 18:50:07 · 284 阅读 · 0 评论 -
linux tcp 的 socket、bind、listen、accept原理分析
基于linux2.4.0分析,讲解服务器端通过socket bind listen、accept系统调用时,触发内核执行流程。我们编写服务器代码时,一般都是socket函数建立服务器socket,然后bind函数绑定地址和端口,然后listen创建一个socket的监听队列,最后死循环(低效操作)accept客户端的连接请求,发送和接收数据。...原创 2021-05-29 16:01:35 · 1024 阅读 · 0 评论 -
sock_alloc原理分析,write与send疑问
在“linux 内核协议栈原理分析之 tcp 服务器端的 send 过程”这篇博客中提到在sys_socket=>sock_create中调用了sock_alloc函数,但是具体里面做了什么,并没有说明。现在我们简单讲解下其中的原理。主要是文件系统相关的内容。struct socket *sock_alloc(void){ struct inode * inode; struct socket * sock; inode = get_empty_inode();//高速缓冲区获取空原创 2021-05-22 16:59:06 · 490 阅读 · 0 评论 -
linux 内核协议栈原理分析之 tcp 服务器端的 send 过程
基于linux2.4.0分析,讲解通过send函数触发内核执行的整个流程。send系统调用最终会走到内核的sys_socketcall函数。后面的调用流程sys_send=>sys_sendto=>sock_sendmsg=>sock->ops->sendmsg发现这个是个函数指针,具体是什么需要看初始化的时候或者accept的时候设置的函数跳转表,这个时候肯定是已经经过三次握手之后,建立的连接。为了解决这个问题,我们先看accept处理过程。/*..原创 2021-05-16 20:27:03 · 1131 阅读 · 0 评论