简体   繁体   English

什么是网络协议?

[英]What is network protocol?

I want to know exactly what a Network Protocol is?我想知道什么是网络协议?
Almost all the definitions on the inte.net say "its a set of rules" inte.net 上的几乎所有定义都说“它是一套规则”
But i want to know how and where these rules exist?但我想知道这些规则是如何以及在哪里存在的? is it a piece of code in a software?它是软件中的一段代码吗? is it a built-in service in an operating system?它是操作系统中的内置服务吗? is it a software?它是一个软件吗? is it a hardware?它是硬件吗?
some websites say its neither a software nore hardware.一些网站说它既不是软件也不是硬件。
But everything in a computer must be either hardware(rigid part) or software(lines of code)但是计算机中的一切都必须是硬件(刚性部分)或软件(代码行)
If its a set of rules, should not these rules be some written code?如果它是一套规则,这些规则不应该是一些书面代码吗?
As i have understood they are responsible for some operations, for example DHCP for assigning dynamic IPs to clients or TCP is responsible for dividing messages into smaller packets, if so should not they considered as a software?据我了解,他们负责某些操作,例如 DHCP 用于为客户端分配动态 IP,或者 TCP 负责将消息分成较小的数据包,如果是这样,他们不应该被视为软件吗?

But i want to know how and where these rules exist?但我想知道这些规则是如何以及在哪里存在的? is it a piece of code in a software?它是软件中的一段代码吗? is it a built-in service in an operating system?它是操作系统中的内置服务吗? is it a software?它是一个软件吗? is it a hardware?它是硬件吗?

It's mostly software/firmware, but not exclusively so.它主要是软件/固件,但并非完全如此。 Especially if you consider L1 (layer-1) standards to be protocols.特别是如果您将 L1(第 1 层)标准视为协议。 For instance, the Ethe.net standard defies everything from the shape and size of the various connectors to how bridges (ie switches) need to manage their forwarding tables.例如,Ethe.net 标准违背了从各种连接器的形状和大小到网桥(即交换机)需要如何管理其转发表的所有内容。 It's all part of the "Ethe.net Protocol".这都是“Ethe.net 协议”的一部分。 Generally speaking, the higher up the protocol stack you go, the more software you encounter.一般来说,你go的协议栈越高,遇到的软件就越多。 The lower you go - the more hardware/firmware you see. go 越低 - 您看到的硬件/固件越多。

As i have understood they are responsible for some operations, for example DHCP for assigning dynamic IPs to clients or TCP is responsible for dividing messages into smaller packets, if so should not they considered as a software?据我了解,他们负责某些操作,例如 DHCP 用于为客户端分配动态 IP,或者 TCP 负责将消息分成较小的数据包,如果是这样,他们不应该被视为软件吗?

Generally speaking, yes.一般来说,是的。 DHCP and TCP are software. DHCP和TCP是软件。 I'm not aware of any hardware DHCP implementations, and I doubt any exist.我不知道有任何硬件 DHCP 实现,我怀疑是否存在。 But, there are hardware components that implement functions such as checksum calculations or header parsing for performance reasons.但是,出于性能原因,有些硬件组件会实现校验和计算或 header 解析等功能。

A.network protocol is a set of rules at the.network layer. A.网络协议是网络层的一组规则。 Since it is at the.network layer, it will have a protocol number that defines these rules.由于是在.network层,它会有一个定义这些规则的协议号。 This number is contained in the associated IP packet in the protocol field (see https://en.wikipedia.org/wiki/IPv4#Header ).此号码包含在协议字段中的关联 IP 数据包中(请参阅https://en.wikipedia.org/wiki/IPv4#Header )。 The rules are usually defined in an RFC or Inte.net draft.这些规则通常在 RFC 或 Inte.net 草案中定义。 To find these rules, see https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml#protocol-numbers-1 .要查找这些规则,请参阅https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml#protocol-numbers-1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM