Chapter Fourteen

IF 0.2 3区 文学 0 LITERATURE, AMERICAN
LEGACY Pub Date : 2009-09-23 DOI:10.5749/j.ctv15kxfxv.18
Joanne Dobson
{"title":"Chapter Fourteen","authors":"Joanne Dobson","doi":"10.5749/j.ctv15kxfxv.18","DOIUrl":null,"url":null,"abstract":"We are now through discussing char and block drivers and are ready to move on to the fascinating world of networking. Network interfaces are the third standard class of Linux devices, and this chapter describes how they interact with the rest of the kernel. The role of a network interface within the system is similar to that of a mounted block device. A block device registers its features in the blk_dev array and other ker nel structur es, and it then \" transmits \" and \" receives \" blocks on request, by means of its request function. Similarly, a network interface must register itself in specific data structures in order to be invoked when packets are exchanged with the outside world. Ther e ar e a few important differ ences between mounted disks and packet-delivery inter faces. To begin with, a disk exists as a special file in the /dev dir ectory, wher eas a network interface has no such entry point. The normal file operations (r ead, write, and so on) do not make sense when applied to network interfaces, so it is not possible to apply the Unix \" everything is a file \" approach to them. Thus, network interfaces exist in their own namespace and export a differ ent set of operations. Although you may object that applications use the read and write system calls when using sockets, those calls act on a software object that is distinct from the inter face. Several hundred sockets can be multiplexed on the same physical interface. But the most important differ ence between the two is that block drivers operate only in response to requests from the kernel, whereas network drivers receive packets asynchronously from the outside. Thus, while a block driver is asked to send a buffer toward the kernel, the network device asks to push incoming packets toward the kernel. The kernel interface for network drivers is designed for this differ ent mode of operation.","PeriodicalId":42944,"journal":{"name":"LEGACY","volume":"26 1","pages":"339 - 345"},"PeriodicalIF":0.2000,"publicationDate":"2009-09-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"LEGACY","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.5749/j.ctv15kxfxv.18","RegionNum":3,"RegionCategory":"文学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"0","JCRName":"LITERATURE, AMERICAN","Score":null,"Total":0}
引用次数: 0

Abstract

We are now through discussing char and block drivers and are ready to move on to the fascinating world of networking. Network interfaces are the third standard class of Linux devices, and this chapter describes how they interact with the rest of the kernel. The role of a network interface within the system is similar to that of a mounted block device. A block device registers its features in the blk_dev array and other ker nel structur es, and it then " transmits " and " receives " blocks on request, by means of its request function. Similarly, a network interface must register itself in specific data structures in order to be invoked when packets are exchanged with the outside world. Ther e ar e a few important differ ences between mounted disks and packet-delivery inter faces. To begin with, a disk exists as a special file in the /dev dir ectory, wher eas a network interface has no such entry point. The normal file operations (r ead, write, and so on) do not make sense when applied to network interfaces, so it is not possible to apply the Unix " everything is a file " approach to them. Thus, network interfaces exist in their own namespace and export a differ ent set of operations. Although you may object that applications use the read and write system calls when using sockets, those calls act on a software object that is distinct from the inter face. Several hundred sockets can be multiplexed on the same physical interface. But the most important differ ence between the two is that block drivers operate only in response to requests from the kernel, whereas network drivers receive packets asynchronously from the outside. Thus, while a block driver is asked to send a buffer toward the kernel, the network device asks to push incoming packets toward the kernel. The kernel interface for network drivers is designed for this differ ent mode of operation.
十四章
我们现在已经讨论了字符和块驱动程序,并准备进入迷人的网络世界。网络接口是Linux设备的第三类标准,本章描述它们如何与内核的其余部分交互。网络接口在系统中的作用类似于挂载的块设备。块设备在blk_dev数组和其他内核结构中注册它的特征,然后通过它的请求函数在请求时“发送”和“接收”块。类似地,网络接口必须在特定的数据结构中注册自己,以便在与外界交换数据包时调用。挂载的磁盘和数据包传递接口之间有几个重要的区别。首先,磁盘作为一个特殊文件存在于/dev目录中,而网络接口没有这样的入口点。普通的文件操作(读、写等等)在应用于网络接口时没有意义,因此不可能对它们应用Unix的“一切都是文件”方法。因此,网络接口存在于它们自己的名称空间中,并导出一组不同的操作。尽管您可能反对应用程序在使用套接字时使用读写系统调用,但这些调用作用于与接口不同的软件对象。几百个套接字可以在同一个物理接口上复用。但是两者之间最重要的区别是,块驱动程序只响应内核的请求,而网络驱动程序从外部异步接收数据包。因此,当要求块驱动程序向内核发送缓冲区时,网络设备要求将传入的数据包推送给内核。网络驱动程序的内核接口是为这种不同的操作模式而设计的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
LEGACY
LEGACY LITERATURE, AMERICAN-
CiteScore
0.10
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书