Which software and hardware parts of a computer are responsible for adding or removing values to the initial payload of a data packet in every layer of OSI or TCP/IP model? In other words, which parts (software or hardware) of a computer are able to capsulate and de-capsulate the packets?
Also, how can I practically add an additional value to the packets in layer transport or perform an additional operation to the packet in the last layer of 1 (physical)?