#REDIRECT [[Internet protocol suite]]
{{IPstack}}
{{R with history}}
The '''[[TCP/IP]] reference model''' or '''TCP/IP model''', sometimes called the '''DoD model''' (DoD, [[United States Department of Defense|Department of Defense]]), [[ARPANET]] reference model or the [[Internet]] reference model, is a layered abstract description for communications and computer [[network protocol]] design. It was created in the [[1970s]] by [[DARPA]] for use in developing the [[Internet]]'s [[Internet protocol suite | protocols]], and the structure of the Internet is still closely reflected by the TCP/IP model. It has fewer, less rigidly defined layers than the commonly referenced [[OSI model]], and thus provides an easier fit for real-world protocols.
No document officially specifies the model; different names are given to the layers by different documents, and different numbers of layers are shown by different documents. There are versions of this model with four layers and with five layers. The four-layer version of the model has
*Layer 4 - '''Process Layer or Application Layer''' - This is where the "higher level" protocols such as [[SMTP]], [[File Transfer Protocol|FTP]], [[SSH]], [[HTTP]], etc. operate.
*Layer 3 - '''Host-To-Host (Transport) Layer''' - This is where flow-control and connection protocols exist, such as [[Transmission Control Protocol|TCP]]. This layer deals with opening and maintaining connections, ensuring that packets are in fact received.
*Layer 2 - '''Internet or Internetworking Layer''' - This layer defines [[IP address]]es, with many routing schemes for navigating packets from one IP address to another.
*Layer 1 - '''Network Access Layer''' - This layer describes the physical equipment necessary for communications, such as [[twisted pair]] cables, the signalling used on that equipment, and the low-level protocols using that signalling.
The five-layer version of the model splits Layer 1 into a Physical layer and a Network Access layer, corresponding to the [[physical layer]] and [[data link layer]] of the OSI model.
=='''Layers in the TCP/IP model'''==
[[Image:IP stack connections.png|thumb|350px|IP suite stack showing the physical network connection of two hosts via two [[router]]s and the corresponding layers used at each hop]]
[[Image:UDP encapsulation.png|thumb|511px|Sample encapsulation of data within a [[User Datagram Protocol|UDP]] datagram within an [[Internet Protocol|IP]] packet]]
The IP suite uses [[encapsulation (networking)|encapsulation]] to provide abstraction of protocols and services. Generally a protocol at a higher level uses a protocol at a lower level to help accomplish its aims. The Internet protocol stack can be roughly fitted to the four layers of the original TCP/IP model:
{| cellpadding="5" cellspacing="1"
|-
|4
|style="border:1px solid black;"|'''Application'''
| [[Domain Name System|DNS]], [[Trivial File Transfer Protocol|TFTP]], [[Transport Layer Security|TLS/SSL]], [[File Transfer Protocol|FTP]], [[HyperText Transfer Protocol|HTTP]], [[Internet Message Access Protocol|IMAP]], [[Internet Relay Chat|IRC]], [[Network News Transfer Protocol|NNTP]], [[Post Office Protocol|POP3]], [[Session Initiation Protocol|SIP]], [[Simple Mail Transfer Protocol|SMTP]], [[Simple Network Management Protocol|SNMP]], [[Secure Shell|SSH]], [[Telnet|TELNET]], [[ECHO protocol|ECHO]], [[BitTorrent]], [[Real-time Transport Protocol|RTP]], [[Peer Name Resolution Protocol|PNRP]], [[rlogin]], [[Endpoint Handlespace Redundancy Protocol|ENRP]], …
|-
|
|
| Routing protocols like [[Border Gateway Protocol|BGP]] and [[Routing information protocol|RIP]], which for a variety of reasons run over TCP and UDP respectively, may also be considered part of the application or network layer.
|-
|3
|style="border:1px solid black;"|'''Transport'''
| [[Transmission Control Protocol|TCP]], [[User Datagram Protocol|UDP]], [[Datagram Congestion Control Protocol|DCCP]], [[Stream Control Transmission Protocol|SCTP]], [[IL Protocol|IL]], [[Reliable User Datagram Protocol|RUDP]], …
|-
|
|
| Routing protocols like [[Open shortest path first|OSPF]], which run over IP, may also be considered part of the transport or network layer. [[Internet control message protocol|ICMP]] and [[Internet group management protocol|IGMP]] run over IP may be considered part of the network layer.
|-
|2
|style="border:1px solid black;"|'''Internet'''
| [[Internet Protocol|IP]] ([[IPv4]], [[IPv6]])
|-
|
|
| [[Address Resolution Protocol|ARP]] and [[Reverse Address Resolution Protocol|RARP]] operate underneath IP but above the link layer so they belong somewhere in between.
|- style="border:1px solid black;"
|1
|style="border:1px solid black;"|'''Network Access'''
| [[Ethernet]], [[Wi-Fi]], [[Token ring]], [[Point-to-Point Protocol|PPP]], [[Serial Line Internet Protocol|SLIP]], [[Fiber distributed data interface|FDDI]], [[Asynchronous Transfer Mode|ATM]], [[Frame Relay]], [[SMDS]], …
|}
In modern text books, the TCP/IP model has evolved into a five layer model, where the network access layer is splitted into a [[data link layer]] on top of a [[physical layer]].
The layers near the top are logically closer to the user while those near the bottom are logically closer to the physical transmission of the data.
Each layer has an [[upper layer protocol]] and a [[lower layer protocol]] (except the top/bottom protocols, of course) that either use said layer's service or provide a service, respectively.
Viewing layers as providing or consuming a service is a method of [[abstraction (computer science)|abstraction]] to isolate upper layer protocols from the nitty gritty detail of transmitting bits over, say, [[Ethernet]] and [[Carrier sense multiple access with collision detection|collision detection]] while the lower layers avoid having to know the details of each and every application and its protocol.
This abstraction also allows upper layers to provide services that the lower layers cannot, or choose not, to provide.
For example, IP is designed to not be reliable and is a [[best effort delivery]] protocol.
This means that all [[transport layer]]s must choose whether or not to provide reliability and to what degree.
UDP provides data integrity (via a [[checksum]]) but does not guarantee delivery; TCP provides both data integrity and delivery guarantee (by retransmitting until the receiver receives the packet).
This model is in some ways lacking.
# For multipoint links with their own addressing systems (e.g. Ethernet) an address mapping protocol is needed. Such protocols can be considered to be below IP but above the existing link system.
# ICMP & IGMP operate on top of IP but do not transport data like UDP or TCP.
# The SSL/TLS library operates above the transport layer (utilizes TCP) but below application protocols.
# The link is treated like a black box here. This is fine for discussing IP (since the whole point of IP is it will run over virtually anything) but is less helpful when considering the network as a whole.
The third and fourth examples are perhaps better explained using the OSI model while the first two are still problematic.
===OSI model comparison===
The IP suite (and corresponding stack), and its layering model, were in use before the [[OSI model]] was established and since then the TCP/IP model has been compared with the OSI model numerous times in books and classrooms. Also, OSI layer numbers are generally used for describing the capabilities of network equipment.
The two can roughly be related but are not a perfect match.
The first striking difference is the layer count.
The DoD model for the IP stack uses four or five layers (the link layer might be treated as a single layer or split into a physical layer and a [[data link layer]]) and the OSI model uses seven.
Strictly comparing names, the two "new" layers are the [[presentation layer]] and the [[session layer]]. Most comparisons lump these two layers with the OSI application layer and equate to the IP application layer.
Much like the TCP/IP model, the OSI model is also not rich enough at the lower layers to capture the true workings of the IP suite.
For example, an "internetworking layer" is needed to fit in between the [[network layer|network]] and [[transport layer]]s to address where [[Internet Control Message Protocol|ICMP]] and [[Internet Group Management Protocol|IGMP]] reside.
Additionally, a layer between the network and [[data link layer]] is needed for [[Address Resolution Protocol|ARP]] and [[Reverse Address Resolution Protocol|RARP]]. It also suffers from being designed for simple network setups having only a single data link layer (for example an ADSL user tunneling into a corporate network could have IP over [[PPTP]] over IP over [[PPPoA]] over the ADSL link)
One example of where the OSI model is better used is showing where [[Transport Layer Security|SSL/TLS]] fits in. Typically, SSL/TLS is used as a session protocol that is an [[upper layer protocol]] for TCP or UDP but is a [[lower layer protocol]] for numerous protocols (HTTP, SFTP, etc.) or any application that operates over a [[stunnel]] or [[virtual private network|secure virtual private network]].
{| cellpadding="5" cellspacing="1"
|-
|7
|style="border:1px solid black;"|'''Application'''
| [[HTTP]], [[Simple Mail Transfer Protocol|SMTP]], [[Simple Network Management Protocol|SNMP]], [[File transfer protocol|FTP]], [[Telnet]], [[ECHO protocol|ECHO]], [[Session Initiation Protocol|SIP]], [[Secure Shell|SSH]], [[Network File System|NFS]], [[RTSP]], [[XMPP]], [[Whois]], [[Endpoint Handlespace Redundancy Protocol|ENRP]]
|-
|6
|style="border:1px solid black;"|'''Presentation'''
| [[External Data Representation|XDR]], [[Abstract Syntax Notation 1|ASN.1]], [[Server message block|SMB]], [[Apple Filing Protocol|AFP]], [[NetWare Core Protocol|NCP]]
|-
|5
|style="border:1px solid black;"|'''Session'''
| [[Aggregate Server Access Protocol|ASAP]], [[Transport Layer Security|TLS]], [[SSL]], ISO 8327 / CCITT X.225, [[Remote procedure call|RPC]], [[NetBIOS]], [[AppleTalk|ASP]]
|-
|4||style="border:1px solid black;"|'''Transport'''
| [[Transmission Control Protocol|TCP]], [[User Datagram Protocol|UDP]], [[Real-time Transport Protocol|RTP]], [[Stream Control Transmission Protocol|SCTP]], [[Sequenced packet exchange|SPX]], [[AppleTalk|ATP]], [[IL Protocol|IL]]
|-
|3
|style="border:1px solid black;"|'''Network'''
| [[Internet Protocol|IP]], [[Internet control message protocol|ICMP]], [[Internet group management protocol|IGMP]], [[IPX]], [[Border Gateway Protocol|BGP]], [[OSPF]], [[Routing information protocol|RIP]], [[IGRP]], [[EIGRP]], [[Address resolution protocol|ARP]], [[RARP]], [[X.25]]
|-
|2
|style="border:1px solid black;"|'''Data Link'''
| [[Ethernet]], [[Token ring]], [[HDLC]], [[Frame relay]], [[Integrated Services Digital Network|ISDN]], [[Asynchronous Transfer Mode|ATM]], [[IEEE 802.11|802.11 WiFi]], [[Fiber distributed data interface|FDDI]], [[Point-to-Point Protocol|PPP]]
|-
|1
|style="border:1px solid black;"|'''Physical'''
| [[10BASE-T]], [[100BASE-T]], [[1000BASE-T]], [[Synchronous optical networking|SONET/SDH]], [[T-carrier]]/[[E-carrier]], various [[IEEE 802.11|802.11]] physical layers
|}
There are several [[OSI model#Mnemonics|mnemonics]] for remembering the order of the layers in the OSI model.
==The layers==
The following is a description of each layer in the IP suite stack.
===Application layer===
The [[application layer]] is used by most programs for network communication. Data is passed from the program in an application-specific format, then [[encapsulation (networking)|encapsulated]] into a transport layer protocol.
Since the IP stack has no layers between the application and transport layers, the application layer must include any protocols that act like the OSI's presentation and session layer protocols. This is usually done through [[Library (computer science)|libraries]].
Data sent over the network is passed into the application layer where it is encapsulated into the application layer protocol. From there, the data is passed down into the [[lower layer protocol]] of the transport layer.
The two most common lower layer protocols are TCP and UDP. Common [[server (computing)|services]] have specific [[TCP and UDP port|port]]s assigned to them ([[HyperText Transfer Protocol|HTTP]] has port 80; [[File Transfer Protocol|FTP]] has port 21; etc.) while [[client (computing)|clients]] use [[TCP and UDP port|ephemeral port]]s.
[[Router]]s and [[network switch|switch]]es do not utilize this layer but [[bandwidth throttling]] applications do.
===Transport layer===
The [[transport layer]]'s responsibilities include end-to-end message transfer capabilities independent of the underlying network, along with error control, fragmentation and flow control. End to end message transmission or connecting applications at the transport layer can be categorized as either:
# [[connection-oriented]] e.g. [[Transmission Control Protocol|TCP]]
# [[connectionless]] e.g [[User Datagram Protocol|UDP]]
The transport layer can be thought of literally as a transport mechanism e.g. a vehicle whose responsibility is to make sure that its contents (passengers/goods) reach its destination safely and soundly.
The transport layer provides this service of connecting applications together through the use of [[TCP and UDP port|ports]].
Since IP provides only a [[best effort delivery]], the transport layer is the first layer to address reliability.
For example, [[Transmission Control Protocol|TCP]] is a connection-oriented protocol that addresses numerous reliability issues to provide a [[reliable byte stream]]:
* data arrives in-order
* data has minimal error-correctness
* duplicate data is discarded
* lost/discarded packets are resent
* includes traffic congestion control
The dynamic routing protocols which technically fit at this layer in the TCP/IP Protocol Suite (since they run over IP) are generally considered to be part of the Network layer; an example is [[OSPF]] (IP protocol number 89).
The newer [[Stream Control Transmission Protocol|SCTP]] is also a "reliable", [[connection-oriented]], transport mechanism. It is stream-oriented — not byte-oriented like TCP — and provides multiple streams multiplexed over a single connection. It also provides [[multi-homed|multi-homing]] support, in which a connection end can be represented by multiple [[IP address]]es (representing multiple physical interfaces), such that if one fails, the connection is not interrupted. It was developed initially for telephony applications (to transport [[SS7]] over [[Internet Protocol|IP]]), but can also be used for other applications.
[[User datagram protocol|UDP]] is a [[connectionless]] [[datagram]] protocol. Like IP, it is a [[best effort delivery|best effort]] or "unreliable" protocol. Reliability is addressed through [[error detection]] using a weak [[checksum]] algorithm. UDP is typically used for applications such as streaming media (audio and video, etc) where on-time arrival is more important than reliability, or for simple query/response applications like [[Domain Name System|DNS]] lookups, where the overhead of setting up a reliable connection is disproportionately large.
[[DCCP]] is currently under development by [[Internet Engineering Task Force|IETF]]. It provides TCP's [[flow control]] semantics, while keeping UDP's datagram service model visible to the user.
Both TCP and UDP are used to carry a number of higher-level applications. The applications at any given network address are distinguished by their TCP or UDP [[TCP and UDP port|port]]. By convention certain ''well known ports'' are associated with specific applications. (''See [[List of TCP and UDP port numbers]].'')
[[Real-time Transport Protocol|RTP]] is a datagram protocol that is designed for [[real-time]] data such as [[streaming media|streaming audio and video]].
RTP is a session layer that uses the UDP packet format as a basis yet is said to sit within the transport layer of the Internet protocol stack.
===Network layer===
As originally defined, the [[Network layer]] solves the problem of getting packets across a single network. Examples of such protocols are [[X.25]], and the [[ARPANET]]'s [[Host/IMP Protocol]].
With the advent of the concept of [[internetworking]], additional functionality was added to this layer, namely getting data from the source [[computer network|network]] to the destination network. This generally involves routing the packet across a network of networks, known as an internetwork or (lower-case) internet.<ref>[http://www.comsci.us/datacom/ippacket.html IP Packet Structure]</ref>
In the Internet protocol suite, [[Internet Protocol|IP]] performs the basic task of getting packets of data from source to destination. IP can carry data for a number of different [[upper layer protocol]]s; these protocols are each identified by a unique protocol number: [[Internet Control Message Protocol|ICMP]] and [[Internet Group Management Protocol|IGMP]] are protocols 1 and 2, respectively.
Some of the protocols carried by IP, such as ICMP (used to transmit diagnostic information about IP transmission) and IGMP (used to manage [[multicast]] data) are layered on top of IP but perform internetwork layer functions, illustrating an incompatibility between the Internet and the IP stack and OSI model. All routing protocols, such as [[Border Gateway Protocol|BGP]], [[OSPF]], and [[Routing information protocol|RIP]] are also really part of the network layer, although they might seem to belong higher in the stack.
===Link layer===
The link layer, which is the method used to move packets from the network layer on two different hosts, is not really part of the Internet protocol suite, because IP can run over a variety of different link layers. The processes of transmitting packets on a given link layer and receiving packets from a given link layer can be controlled both in the [[software]] [[device driver]] for the [[network card]], as well as on [[firmware]] or specialist [[chipsets]]. These will perform [[data link layer|data link]] functions such as adding a [[packet header]] to prepare it for transmission, then actually transmit the frame over a [[physical layer|physical]] [[transmission medium|medium]].
For Internet access over a dial-up [[modem]], IP packets are usually transmitted using [[Point-to-Point Protocol|PPP]]. For [[broadband Internet access]] such as [[ADSL]] or [[cable modem]]s, [[PPPoE]] is often used. On a local wired network, [[Ethernet]] is usually used, and on local wireless networks, [[IEEE 802.11]] is usually used. For [[wide-area networks]], either PPP over [[T-carrier]] or [[E-carrier]] lines, [[Frame relay]], [[Asynchronous Transfer Mode|ATM]], or [[packet over SONET/SDH]] (POS) are often used.
The link layer can also be the layer where packets are intercepted to be sent over a [[virtual private network]].
When this is done, the link layer data is considered the application data and proceeds back down the IP stack for actual transmission.
On the receiving end, the data goes up the IP stack twice (once for routing and the second time for the VPN).
The link layer can also be considered to include the physical layer, which is made up of the actual physical network components (hubs, repeaters, fiber optic cable, coaxial cable, network cards, Host Bus Adapter cards and the associated network connectors: RJ-45, BNC, etc), and the low level specifications for the signals (voltage levels, frequencies, etc).
===Physical Layer===
The Physical layer is responsible for encoding and transmission of data over network communications media. It operates with data in the form of bits that are sent from the Physical layer of the sending (source) device and received at the Physical layer of the destination device.
Ethernet, Token Ring, SCSI, hubs, repeaters, cables and connectors are standard network devices that function at the Physical layer. The Physical layer is also considered the ___domain of many hardware-related network design issues, such as LAN and WAN topology and wireless technology too.
==See also==
*[[OSI model]]
[[Category:Network architecture]]
[[de:DoD-Schichtenmodell]]
[[pl:Model DoD]]
|