network-programmingipnetwork-protocolsdhcp

What is network protocol?


I want to know exactly what a Network Protocol is?
Almost all the definitions on the internet say "its a set of rules"
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?


Solution

  • 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. For instance, the Ethernet standard defies everything from the shape and size of the various connectors to how bridges (i.e. switches) need to manage their forwarding tables. It's all part of the "Ethernet Protocol". Generally speaking, the higher up the protocol stack you go, the more software you encounter. The lower you go - the more hardware/firmware you see.

    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?

    Generally speaking, yes. DHCP and TCP are software. I'm not aware of any hardware DHCP implementations, and I doubt any exist. But, there are hardware components that implement functions such as checksum calculations or header parsing for performance reasons.