# data[].attributes.attachment_link.readable_text
In this blog post, we will look into client-server architecture, compare it to peer-to-peer, and find out exactly when client-server is better than P2P. For those of you who aren't willing to spend few minutes reading through the article, I'll give an immediate answer - peer-to-peer is always better than client-server.

The client-server architecture is the most commonly used approach for data transfer. It designates a computer as a server and another one as a client. In a client-server architecture, the server needs to be online all the time, and get good connectivity. The server provides its clients with data, and can also receive data from clients. Some examples of widely used client-server applications are HTTP, FTP, rsync. All of these applications have a specific server-side functionality that implements the protocol.

Availability

The most obvious problem that all client-server applications face is that server always has to be online and available. In case of any software, network or hardware problem, the service to all clients is affected. Therefore, you need to plan a server high availability solution in advance. High availability ensures that the system switches to a backup hardware or network if it's disrupted for any reason, and the service can continue to operate smoothly. This problem is quite complex since you need to keep data synchronized between your live machine and backup machine, and properly plan software and hardware updates in advance to support uninterrupted service operation.

High Load

Another recurring problem with client-server applications is high load. A single powerful client that consumes data faster than the others could consume all the networking, disk operation and server CPU. You want all clients to have access to the server. Therefore you need to limit clients to a certain consumption level, so each of them can get minimal server resources. This approach makes sure that the powerful client won't disrupt the other clients. But in reality, it usually means that the server always serves a client with the limitation in place, even if it's not overloaded and can operate faster.

Scalability

Each server needs to be planned for the specific amount of clients it will support. When the number of clients grows, the server CPU, memory, networking, and disk performance need to grow as well, and can eventually reach a point when the server stops operation. If you have more clients than a single server can serve, you probably need to deploy several servers. This means designing a system to balance and distribute load between servers, in addition to the high availability system we discussed previously.

And how does peer-to-peer stack up?

Availability

In a peer-to-peer world, each client is also the server. If the central machine is not available the service can be provided by any available client or a group of clients. The peer-to-peer system will find the group of best clients and will request service from them. This gives you service availability that doesn't depend on one machine and doesn't require the development of any high availability solution.

High Load

The peer-to-peer, in comparison to client-server architecture, converts each node to a server that can provide service. Therefore if a powerful client needs a lot of data, several other devices can provide it. Therefore each client can download data at the fastest possible speed without any limitations.

Scalability

Obviously, the more devices you have in a network the more devices will be able to participate in data delivery. They will participate in terms of network, CPU distributing this load from a central server. The more devices you have the less load will be on the central server.

Let's see how this works in a couple real case scenarios.

Build distribution

Development companies struggle to deliver builds faster to remote offices across the globe, or within one office to hundreds of fast QA machines. In a client-server world, all remote offices will download build from a build machine. The speed limitation will be determined by the network channel that serves the build to all remote offices. A peer-to-peer approach would split the build into independent blocks that could travel between offices independently. This approach removes network limitation from the main office and combines the speed of all remote offices to deliver builds faster. Usually, you can get 3-5 times faster on a peer-to-peer architecture than on client-server.

Another issue is distributing build within a single office from a central server. The fast QA machines completely overload the central server network and CPU, bringing the central server to an unusable state. It is an almost unsolvable scalability issue. As we discussed above, a peer-to-peer approach is better when many clients need access to the data. Each QA machine can seed the data to other machines, keeping the server in a healthy state and delivering builds blazingly fast.

Data delivery to remote offices

Delivering data to a remote office usually faces the issue of overloading the central server. Even if the speed of each office is not that fast, when you have many of them it adds up and requires huge bandwidth channels to the central office. A problem can occur when you need to deliver software or OS updates as well as other data such as documents, video or images. The peer-to-peer approach solves that by allowing each remote office to participate in data delivery. This reduces the load on the central server, and significantly reduces central server and networking requirement.

Another long-lasting problem peer to peer solves is when the data needs to be distributed to several machines within the office. The previous approach was to either download from the central server which would increase load even more, or develop a two-step distribution policy: deliver data to the central server within the remote location, and then copy data locally. The peer-to-peer solves that naturally by finding the best source for the data, whether it is a local server or remote server. Once the block of the data is present in the remote office, it won't necessarily be downloaded from the central data center.

Busting common P2P myths

Myth #1: P2P is only faster when you download from many peers

While the speed of the p2p network grows as more clients join the transfer. The point to point and distribution of data from one node to several nodes is faster too.

Myth #2: P2P exposes your network and computers to viruses, hackers, and other security risks

This misconception originates in the popular private P2P use case of illegal file sharing. Illegal file sharing exposes your infrastructure and computers to all the problems. The risk for an enterprise P2P application does not exist, since all entities participating in distribution are secure enterprise machines.

Myth #3: P2P is not secure.

As we saw above, peer to peer is just a way to establish a connection and assign roles between machines. It does need additional security mechanisms that can perform mutual authentication and authorization, as well as access control and traffic encryption. However, these additional security features are built into enterprise P2P solutions like Resilio Connect.

How much faster is P2P?

We wrote an article about this previously, with a concrete example: Why P2P is faster. In a nutshell, P2P is always faster. How much faster depends on data size and scale. The larger they are, the bigger the differences. In the example in the article, client-server took 3X as long to send a 100GB file.

But it's important to remember that using P2P is not only faster, it also:

Introduces significant savings on equipment and infrastructure

Is more robust and resilient.

How much time could you save by using P2P?
Schedule a demo to find out

# data[].attributes.attachment_link.title
What's the difference between peer to peer and client server? - Resilio Blog

# data[].attributes.attachment_link.description
In this blog post, we will look into client-server architecture, compare it to peer-to-peer, and find out exactly when client-server is better than P2P. For those of you who aren't willing to spend few minutes reading through the article, I'll give an immediate answer - peer-to-peer is always better than client-server.

# data[].attributes.body
As Jonathan would say
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

# data[].attributes.attachment_link.readable_text
Any one starting to learn about computer networking will be faced with learning about the OSI and TCP/IP networking models, and the TCP/IP protocol suite.

In this tutorial we will look at networking protocol models, and explain how and why they are structured into layers.

We will then look at the most common protocol suite, the TCP/IP protocol suite and the 4 layer model.

What you will Learn

What are Protocols and what is a protocol suite

Why Protocols use a stack or layer model

The OSI and TCP/IP models

How Protocols work across Networks.

The TCP/IP model ,protocol layers and the main protocols at each layer.

Networking equipment and networking levels

What is a Protocol ?

A protocol is a set of rules that govern how systems communicate. For networking they govern how data is transferred from one system to another.

What is a Protocol Suite ?

A protocol suite is a collection of protocols that are designed to work together.

Before TCP/IP became the de-facto standard other protocol suites like IPX and SPX were common (Novell).

Protocol Stacks

It is possible to write a single protocol that takes data from one computer application and sends it to an application on another computer.- A Single stack Protocol

The problem with this approach is that it very inflexible, as any changes require changing the entire application and protocol software.

The approach used in networking is to create layered protocol stacks.

Each level of the stack performs a particular function and communicates with the levels above and below it.

This layered arrangement is not confined to networking, and how it works is probably best understood if you compare it to real life example.

Lets take an example of a parcel service between two offices.

The task is simple - send parcels between people in each office.

We will divide the task into two distinct processes as follows:

1. Take a package, wrap it and address it.

2. Send it to the destination

at the receiving end

1. Receive the package

2. Deliver it to the recipient

Typically you would have an internal mail man that:

1. Collects the parcels from the senders and takes then to a mail dispatch room.

2. The parcels are placed in a van by the dispatcher and then driven to the remote office.

At the remote office

1. The parcels are received by the dispatcher and placed into a tray for the mail man

2. The mail man collects the parcels and delivers them to the recipients,

Here is a simple diagram to illustrate the process:

The question really is what is the advantage of splitting the task into different layers/tasks?

The answer is that any of the layers/tasks can be changed without affecting the other layers.

So if for example, if we decide to use a train instead of a van to transport the messages between the offices we could do so without affecting the mail man.

In fact the mail man doesn't know, and doesn't care, how the parcels are transported between the offices, as all he does is collect them, and pass them to the delivery man.

Although this appears very simple, and maybe trivial, it does illustrate some very important points that are crucial when it comes to understanding networking protocols and how they are organised.

The OSI and TCP/IP Networking Models

All networking courses teach the 7 layer OSI model.

It is important to understand that this model provides for a conceptual framework, and no modern protocols implement this model fully.

The TCP/IP protocol suite uses a 4 layer model.

Note: The OSI model is an idealised networking model, whereas the TCP/IP model is a practical implementation.

The diagram shows how the TCP/IP and OSI models compare

This article has a good overview of the OSI protocol layers and their functions

What is important to understand is that the interfaces between the interfaces are well defined so that it is theoretically possible to replace a particular protocol with another one that operates at that level.

For example you should theoretically be able to replace the IP networking protocol with the IPX networking protocol without affecting how the application e.g. POP3 works.

Although this doesn't always apply the application protocols like SMTP ,POP3 etc will work Okay across different data link protocols like Ethernet,Token ring etc.

End to End Connections- Routers,Switches and OSI

When two computers communicate across a network the data must travel through various items of networking equipment.

You will often hear the terms level 2 and level 3 equipment used. These terms refer to the OSI levels of the protocol stack that the device operates at.

A router for example works at the networking layer and is a level 3 device.

A switch operates at the Ethernet level and is a level 2 device.

Because a router operates at the networking layer it doesn't need to support the upper layer application protocols like HTTP,FTP etc.

The router works on network address which are part of the networking protocol ( IP or IPX).

A router can route many different protocols at the same time, but it doesn't do protocol conversion.

An IP packet coming in will be an IP packet going out and an IPX packet coming in will be an IPX packet going out.

To do protocol conversion you will need a Gateway.

Likewise a switch doesn't have level 3,4,5,6 or 7 protocol stacks as it doesn't need them, and so it doesn't care about the routing protocol IP,IPX etc or the application FTP,HTTP etc that passes through it.

Because the switch operates at level 2 (data link layer) it only needs to understand the MAC addresses that are part of the Ethernet protocol.

The TCP/IP Protocol Suite

The TCP/IP protocol suite consists of many protocols that operate at one of 4 layers.

The protocol suite is named after two of the most common protocols - TCP (transmission Control Protocol) and IP (internet Protocol).

TCP/IP was designed to be independent of networking Hardware and should run across any connection media.

The earliest use, and the most common use is over Ethernet networks.

Ethernet is a 2 layer protocol/standard covering the physical and data link layer, shown in the diagram above.
Important Notes:
HTTP (hypertext transfer protocol) -This is the workhorse of the Web.

SMTP,POP3,IMap4 - These are email protocols

TCP (Transmission control protocol) is a connection orientated protocol and is used to provides a reliable end to end connection.

UDP (used datagram protocol) is connection less protocol and doesn't guarantee delivery. See UDP vs TCP- what is the Difference?

Applications will choose which transmission protocol to use based on their function. HTTP, POP3, IMAP4, SMTP and many more use TCP.

UDP is used more in utility applications like DNS, RIP (routing information protocol), DHCP.

IP (Internet Protocol) - This is the main networking protocol. There are two version of IP ( IPv4 and IPV6).

ARP (address resolution Protocol) -Translates an IP address to a MAC or physical address.(IP4 networks)

Summary

The TCP/IP protocol suite is a collection of protocols that are used on the Internet.

It is named after two of the main protocols ( TCP and IP) and uses a 4 layer networking model.

Questions?

What's missing from this tutorial? What isn't properly explained? Let me know using the comments section below and help me improve this tutorial..
Related Articles and resources:

# data[].attributes.attachment_link.title
The TCP/IP Model and Protocol Suite Explained for Beginners

# data[].attributes.attachment_link.description
Any one starting to learn about computer networking will be faced with learning about the OSI and TCP/IP networking models, and the TCP/IP protocol suite. In this tutorial we will look at networking protocol models, and explain how and why they are structured into layers.

# data[].attributes.attachment_link.description
The following table presents a brief comparison of the relative benefits and drawbacks of peer-to-peer (P2P) networks versus client server networks. It is very incomplete and one-sided at the moment, and basically restates what was presented at the May 17 Global meeting. Additional information will be added as time permits.

# data[].attributes.body
Physical, logical, LANs WANs

# data[].attributes.attachment_link.title
Domain 2: Network Media and Topologies - Wikibooks, open books for an open world

# data[].attributes.attachment_link.description
Network Plus Certification Domain 2: Network Media and Topologies

# data[].attributes.attachment_link.title
Fundamentals of Information Systems Security/Telecommunications and Network Security - Wikibooks, open books for an open world

# data[].attributes.attachment_link.description
An internetwork is a collection of individual networks, connected by intermediate networking devices, that functions as a single large network. Internetworking refers to the industry, products, and procedures that meet the challenge of creating and administering internetworks

# data[].attributes.attachment_link.description
In 100 Mbps (megabits per second) Ethernet (known as Fast Ethernet), there are three types of physical wiring that can carry signals: 100BASE-T4 (four pairs of telephone twisted pair wire) 100BASE-TX (two pairs of data grade twisted-pair wire) 100BASE-FX (a two-strand optical fiber cable) This designation is an Institute of Electrical and Electronics Engineers shorthand identifier.

# data[].attributes.headline
Illustration of the differnet layers of OSI and TCP/IP

# data[].attributes.subject
Illustration of the differnet layers of OSI and TCP/IP

# data[].attributes.body
Video

# data[].attributes.attachment_link.title
CompTIA Network+ Certification [License to Tech] Ep 011: OSI and TCP/IP Model

# data[].attributes.attachment_link.description
The Open Systems Interconnection OSI model divides computer network architecture into 7 layers in a logical progression, from Physical to Application.

# data[].attributes.attachment_link.title
The 7 Layers of the OSI Model - Webopedia Study Guide

# data[].attributes.attachment_link.description
The OSI model defines a networking framework to implement protocols in seven layers. This study guide compares the different layers of the OSI.

# data[].attributes.attachment_link.description
Examples of Application layer interfaces for TCP/IP applications are Windows Sockets and NetBIOS. Windows Sockets provides a standard application programming interface (API) under Windows 2000. NetBIOS is an industry standard interface for accessing protocol services such as sessions, datagrams, and name resolution. More information on Windows Sockets and NetBIOS is provided later in this chapter.

# data[].attributes.attachment_link.description
Each layer of the TCP/IP has a particular function to perform and each layer is completely separate from the layer(s) next to it. The communication process that takes place, at its simplest between two computers, is that the data moves from layer 4 to 3 to 2 then to 1 and the information sent arrives at the second system and moves from 1 to 2 to 3 and then finally to layer 4.

# data[].attributes.attachment_link.readable_text
Transmission Control Protocol (TCP) and Internet Protocol (IP) are two distinct computer network protocols. TCP and IP are so commonly used together, however, that TCP/IP has become standard terminology for referring to this suite of protocols.

A protocol is an agreed-upon set of procedures and rules. When two computers follow the same protocols - the same set of rules - they can understand each other and exchange data.

TCP/IP functionality is divided into four layers, each with its own set of agreed-upon protocols:

The datalink layer consists of methods and protocols that operate only on a link, which is the network component that interconnects nodes or hosts in the network. Protocols in the layer include Ethernet and ARP (Address Resolution Protocol).

The internet (or networking) layer connects independent networks to transport the packets containing the data across network boundaries. Protocols are IP and ICMP (Internet Control Message Protocol).

The transport layer handles communications between hosts and is responsible for flow control, reliability, and multiplexing. Protocols include TCP and UDP (User Datagram Protocol).

The application layer standardizes data exchange for applications. Protocols include HTTP, FTP, POP3, SMTP, and SNMP (respectively, HyperText Transfer Protocol, File Transfer Protocol, Post Office Protocol Version 3, Simple Mail Transfer Protocol, and Simple Network Time Protocol).

TCP/IP technically applies to network communications in which the TCP transport is used to deliver data across IP networks. Known as a connection-oriented protocol, TCP works by establishing a virtual connection between two devices via a series of request and reply messages sent across the physical network.

TCP divides a message or file into packets that are transmitted over the internet and then reassembled when they reach their destination.

IP is responsible for the address of each packet so that it gets to the correct destination.

Most computer users have heard the term "TCP/IP" even if they don't know what it means. The average person on the internet works in a predominately TCP/IP environment. Web browsers, for example, use TCP/IP to communicate with web servers. The transfer of information work so seamlessly that millions of people use TCP/IP every day to send email, chat online, and play online games without ever being aware of it.

# data[].attributes.attachment_link.title
What Is Transmission Control Protocol/Internet Protocol (TCP/IP)?

# data[].attributes.attachment_link.description
Transmission Control Protocol (TCP) and Internet Protocol (IP) are two distinct computer network protocols. TCP and IP are so commonly used together, however, that TCP/IP has become standard terminology for referring to this suite of protocols. A protocol is an agreed-upon set of procedures and rules.

# data[].attributes.attachment_link.readable_text
UDP (User Datagram Protocol) is an alternative communications protocol to Transmission Control Protocol ( TCP) used primarily for establishing low-latency and loss-tolerating connections between applications on the internet.

Both UDP and TCP run on top of the Internet Protocol (IP) and are sometimes referred to as UDP/IP or TCP/IP. But there are important differences between the two.

Where UDP enables process-to-process communication, TCP supports host-to-host communication. TCP sends individual packets and is considered a reliable transport medium; UDP sends messages, called datagrams, and is considered a best-effort mode of communications.

In addition, where TCP provides error and flow control, no such mechanisms are supported in UDP. UDP is considered a connectionless protocol because it doesn't require a virtual circuit to be established before any data transfer occurs.

UDP provides two services not provided by the IP layer. It provides port numbers to help distinguish different user requests and, optionally, a checksum capability to verify that the data arrived intact.

TCP has emerged as the dominant protocol used for the bulk of internet connectivity due to its ability to break large data sets into individual packets, check for and resend lost packets, and reassemble packets in the correct sequence. But these additional services come at a cost in terms of additional data overhead and delays called latency.

In contrast, UDP just sends the packets, which means that it has much lower bandwidth overhead and latency. With UDP, packets may take different paths between sender and receiver and, as a result, some packets may be lost or received out of order.

Applications of UDP

UDP is an ideal protocol for network applications in which perceived latency is critical, such as in gaming and voice and video communications, which can suffer some data loss without adversely affecting perceived quality. In some cases, forward error correction techniques are used to improve audio and video quality in spite of some loss.

UDP can also be used in applications that require lossless data transmission when the application is configured to manage the process of retransmitting lost packets and correctly arranging received packets. This approach can help to improve the data transfer rate of large files compared to TCP.

In the Open Systems Interconnection ( OSI) communication model, UDP, like TCP, is in Layer 4, the transport layer. UDP works in conjunction with higher level protocols to help manage data transmission services including Trivial File Transfer Protocol ( TFTP), Real Time Streaming Protocol ( RTSP), Simple Network Protocol (SNP) and domain name system ( DNS) lookups.

User datagram protocol features

The user datagram protocol has attributes that make it advantageous for use with applications that can tolerate lost data.

It allows packets to be dropped and received in a different order than they were transmitted, making it suitable for real-time applications where latency might be a concern.

It can be used for transaction-based protocols, such as DNS or Network Time Protocol.

It can be used where a large number of clients are connected and where real-time error correction isn't necessary, such as gaming, voice or video conferencing, and streaming media.

UDP header composition

The User Datagram Protocol header has four fields, each of which is 2 bytes. They are:

source port number, which is the number of the sender;

destination port number, the port the datagram is addressed to;

length, the length in bytes of the UDP header and any encapsulated data; and

checksum, which is used in error checking. Its use is required in IPv6 and optional in IPv4.

UDP header format

Continue Reading About UDP (User Datagram Protocol)

Dig Deeper on Network protocols and standards

Margaret Rouse asks:

In which applications would you consider not using the User Datagram Protocol?

# data[].attributes.attachment_link.title
What is UDP (User Datagram Protocol)? - Definition from WhatIs.com

# data[].attributes.attachment_link.description
UDP (User Datagram Protocol) is an alternative communications protocol to Transmission Control Protocol ( TCP) used primarily for establishing low-latency and loss-tolerating connections between applications on the internet. Both UDP and TCP run on top of the Internet Protocol (IP) and are sometimes referred to as UDP/IP or TCP/IP.

# data[].attributes.attachment_link.readable_text
You've probably seen references to TCP and UDP when setting up port-forwarding on a router or when configuring firewall software. These two protocols are used for different types of data.

TCP/IP is a suite of protocols used by devices to communicate over the Internet and most local networks. It is named after two of it's original protocols-the Transmission Control Protocol (TCP) and the Internet Protocol (IP). TCP provides apps a way to deliver (and receive) an ordered and error-checked stream of information packets over the network. The User Datagram Protocol (UDP) is used by apps to deliver a faster stream of information by doing away with error-checking. When configuring some network hardware or software, you may need to know the difference.

What They Have In Common

RELATED: How to Find Your Private and Public IP Addresses

Both TCP and UDP are protocols used for sending bits of data-known as packets-over the Internet. Both protocols build on top of the IP protocol. In other words, whether you're sending a packet via TCP or UDP, that packet is sent to an IP address. These packets are treated similarly, as they're forwarded from your computer to intermediary routers and on to the destination.

TCP and UDP aren't the only protocols that work on top of IP. However, they are the most widely used.

How TCP Works

TCP is the most commonly used protocol on the Internet.

When you request a web page in your browser, your computer sends TCP packets to the web server's address, asking it to send the web page back to you. The web server responds by sending a stream of TCP packets, which your web browser stitches together to form the web page. When you click a link, sign in, post a comment, or do anything else, your web browser sends TCP packets to the server and the server sends TCP packets back.

TCP is all about reliability-packets sent with TCP are tracked so no data is lost or corrupted in transit. This is why file downloads don't become corrupted even if there are network hiccups. Of course, if the recipient is completely offline, your computer will give up and you'll see an error message saying it can't communicate with the remote host.

TCP achieves this in two ways. First, it orders packets by numbering them. Second, it error-checks by having the recipient send a response back to the sender saying that it has received the message. If the sender doesn't get a correct response, it can resend the packets to ensure the recipient receives them correctly.

Process Explorer and other system utilities can show the type of connections a process makes-here we can see the Chrome browser with open TCP connections to a variety of web servers.

How UDP Works

RELATED: How Latency Can Make Even Fast Internet Connections Feel Slow

The UDP protocol works similarly to TCP, but it throws out all the error-checking stuff. All the back-and-forth communication introduce latency, slowing things down.

When an app uses UDP, packets are just sent to the recipient. The sender doesn't wait to make sure the recipient received the packet-it just continues sending the next packets. If the recipient misses a few UDP packets here and there, they are just lost-the sender won't resend them. Losing all this overhead means the devices can communicate more quickly.

UDP is used when speed is desirable and error correction isn't necessary. For example, UDP is frequently used for live broadcasts and online games.

For example, let's say you're watching a live video stream, which are often broadcast using UDP instead of TCP. The server just sends a constant stream of UDP packets to computers watching. If you lose your connection for a few seconds, the video may freeze or get jumpy for a moment and then skip to the current bit of the broadcast. If you experience minor packet-loss, the video or audio may be distorted for a moment as the video continues to play without the missing data.

This works similarly in online games. If you miss some UDP packets, player characters may appear to teleport across the map as you receive the newer UDP packets. There's no point in requesting the old packets if you missed them, as the game is continuing without you. All that matters is what's happening right now on the game server-not what happened a few seconds ago. Ditching TCP's error correction helps speed up the game connection and reduce latency.

So What?

RELATED: How to Use Wireshark to Capture, Filter and Inspect Packets

Whether an application uses TCP or UDP is up to its developer, and the choice depends on what an application needs. Most apps need the error-correction and robustness of TCP, but some applications need the speed and reduced overhead of UDP. If you fire a network analysis tool like Wireshark, you can see the different types of packets travelling back and forth.

Unless you're a network administrator or software developer, this shouldn't doesn't affect you too much. If you're configuring your router or firewall software and you're not sure whether an application uses TCP or UDP, you can generally select the "Both" option to have your router or firewall apply the same rule to both TCP and UDP traffic.

# data[].attributes.attachment_link.title
What's the Difference Between TCP and UDP?

# data[].attributes.attachment_link.description
You've probably seen references to TCP and UDP when setting up port-forwarding on a router or when configuring firewall software. These two protocols are used for different types of data. TCP/IP is a suite of protocols used by devices to communicate over the Internet and most local networks.

# data[].attributes.attachment_link.readable_text
In computer networking, the User Datagram Protocol ( UDP) is one of the core members of the Internet protocol suite. The protocol was designed by David P. Reed in 1980 and formally defined in RFC 768. With UDP, computer applications can send messages, in this case referred to as , to other hosts on an Internet Protocol (IP) network. Prior communications are not required in order to set up communication channels or data paths.

UDP uses a simple connectionless communication model with a minimum of protocol mechanisms. UDP provides checksums for data integrity, and port numbers for addressing different functions at the source and destination of the datagram. It has no handshaking dialogues, and thus exposes the user's program to any unreliability of the underlying network; there is no guarantee of delivery, ordering, or duplicate protection. If error-correction facilities are needed at the network interface level, an application may use Transmission Control Protocol (TCP) or Stream Control Transmission Protocol (SCTP) which are designed for this purpose.

UDP is suitable for purposes where error checking and correction are either not necessary or are performed in the application; UDP avoids the overhead of such processing in the protocol stack. Time-sensitive applications often use UDP because dropping packets is preferable to waiting for packets delayed due to retransmission, which may not be an option in a real-time system.

UDP is a simple message-oriented transport layer protocol that is documented in RFC 768. Although UDP provides integrity verification (via checksum) of the header and payload, it provides no guarantees to the upper layer protocol for message delivery and the UDP layer retains no state of UDP messages once sent. For this reason, UDP sometimes is referred to as Unreliable Datagram Protocol. If transmission reliability is desired, it must be implemented in the user's application.

A number of UDP's attributes make it especially suited for certain applications.

Applications can use datagram sockets to establish host-to-host communications. An application binds a socket to its endpoint of data transmission, which is a combination of an IP address and a port. In this way, UDP provides application multiplexing. A port is a software structure that is identified by the port number, a 16 bit integer value, allowing for port numbers between 0 and 65535. Port 0 is reserved, but is a permissible source port value if the sending process does not expect messages in response.

The Internet Assigned Numbers Authority (IANA) has divided port numbers into three ranges. Port numbers 0 through 1023 are used for common, well-known services. On Unix-like operating systems, using one of these ports requires superuser operating permission. Port numbers 1024 through 49151 are the registered ports used for IANA-registered services. Ports 49152 through 65535 are dynamic ports that are not officially designated for any specific service, and may be used for any purpose. These may also be used as ephemeral ports, which software running on the host may use to dynamically create communications endpoints as needed.

A UDP datagram consists of a datagram header and a data section. The UDP datagram header consists of 4 fields, each of which is 2 bytes (16 bits). The data section follows the header and is the payload data carried for the application.

The use of the checksum and source port fields is optional in IPv4 (pink background in table). In IPv6 only the source port field is optional.

Source port number

This field identifies the sender's port, when used, and should be assumed to be the port to reply to if needed. If not used, it should be zero. If the source host is the client, the port number is likely to be an ephemeral port number. If the source host is the server, the port number is likely to be a well-known port number.

Destination port number

This field identifies the receiver's port and is required. Similar to source port number, if the client is the destination host then the port number will likely be an ephemeral port number and if the destination host is the server then the port number will likely be a well-known port number.

Length

This field specifies the length in bytes of the UDP header and UDP data. The minimum length is 8 bytes, the length of the header. The field size sets a theoretical limit of 65,535 bytes (8 byte header + 65,527 bytes of data) for a UDP datagram. However the actual limit for the data length, which is imposed by the underlying IPv4 protocol, is 65,507 bytes (65,535 − 8 byte UDP header − 20 byte IP header).

Using IPv6 jumbograms it is possible to have UDP datagrams of size greater than 65,535 bytes. RFC 2675 specifies that the length field is set to zero if the length of the UDP header plus UDP data is greater than 65,535.

Checksum

The checksum field may be used for error-checking of the header and data. This field is optional in IPv4, and mandatory in IPv6. The field carries all-zeros if unused.

The method used to compute the checksum is defined in RFC 768:

Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.

In other words, all 16-bit words are summed using one's complement arithmetic. Add the 16-bit values up. On each addition, if a carry-out (17th bit) is produced, swing that 17th carry bit around and add it to the least significant bit of the running total. Finally, the sum is then one's complemented to yield the value of the UDP checksum field.

If the checksum calculation results in the value zero (all 16 bits 0) it should be sent as the one's complement (all 1s) as a zero-value checksum indicates no checksum has been calculated. In this case, any specific processing is not required at the receiver, because all 0s and all 1s are equal to zero in 1's complement arithmetic.

The difference between IPv4 and IPv6 is in the pseudo header used to compute the checksum and the checksum is not optional in IPv6.

When UDP runs over IPv4, the checksum is computed using a "pseudo header" that contains some of the same information from the real IPv4 header. The pseudo header is not the real IPv4 header used to send an IP packet, it is used only for the checksum calculation.

The source and destination addresses are those in the IPv4 header. The protocol is that for UDP (see List of IP protocol numbers): 17 (0x11). The UDP length field is the length of the UDP header and data. The field data stands for the transmitted data.

UDP checksum computation is optional for IPv4. If a checksum is not used it should be set to the value zero.

When UDP runs over IPv6, the checksum is mandatory. The method used to compute it is changed as documented in RFC 2460:

Any transport or other upper-layer protocol that includes the addresses from the IP header in its checksum computation must be modified for use over IPv6 to include the 128-bit IPv6 addresses.

When computing the checksum, again a pseudo header is used that mimics the real IPv6 header:

The source address is the one in the IPv6 header. The destination address is the final destination; if the IPv6 packet does not contain a Routing header, that will be the destination address in the IPv6 header; otherwise, at the originating node, it will be the address in the last element of the Routing header, and, at the receiving node, it will be the destination address in the IPv6 header. The value of the Next Header field is the protocol value for UDP: 17. The UDP length field is the length of the UDP header and data.

Lacking reliability, UDP applications must be willing to accept some packet loss, reordering, errors or duplication. If using UDP, the end user applications must provide any necessary handshaking such as real time confirmation that the message has been received. Applications, such as TFTP, may add rudimentary reliability mechanisms into the application layer as needed. If an application requires a high degree of reliability, a protocol such as the Transmission Control Protocol may be used instead.

Most often, UDP applications do not employ reliability mechanisms and may even be hindered by them. Streaming media, real-time multiplayer games and voice over IP (VoIP) are examples of applications that often use UDP. In these particular applications, loss of packets is not usually a fatal problem. In VoIP, for example, latency and jitter are the primary concerns. The use of TCP would cause jitter if any packets were lost as TCP does not provide subsequent data to the application while it is requesting re-sending of the missing data.

Numerous key Internet applications use UDP, including: the Domain Name System (DNS), where queries must be fast and only consist of a single request followed by a single reply packet, the Simple Network Management Protocol (SNMP), the Routing Information Protocol (RIP) and the Dynamic Host Configuration Protocol (DHCP).

Voice and video traffic is generally transmitted using UDP. Real-time video and audio streaming protocols are designed to handle occasional lost packets, so only slight degradation in quality occurs, rather than large delays if lost packets were retransmitted. Because both TCP and UDP run over the same network, many businesses are finding that a recent increase in UDP traffic from these real-time applications is hindering the performance of applications using TCP, such as point of sale, accounting, and database systems. When TCP detects packet loss, it will throttle back its data rate usage. Since both real-time and business applications are important to businesses, developing quality of service solutions is seen as crucial by some.

Some VPN systems such as OpenVPN may use UDP and perform error checking at the application level while implementing reliable connections.

Transmission Control Protocol is a connection-oriented protocol and requires handshaking to set up end-to-end communications. Once a connection is set up, user data may be sent bi-directionally over the connection.

Reliable - TCP manages message acknowledgment, retransmission and timeouts. Multiple attempts to deliver the message are made. If data gets lost along the way, data will be resent. In TCP, there's either no missing data, or, in case of multiple timeouts, the connection is dropped.

Ordered - If two messages are sent over a connection in sequence, the first message will reach the receiving application first. When data segments arrive in the wrong order, TCP buffers the out-of-order data until all data can be properly re-ordered and delivered to the application.

Heavyweight - TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control.

Streaming - Data is read as a byte stream, no distinguishing indications are transmitted to signal message (segment) boundaries.

User Datagram Protocol is a simpler message-based connectionless protocol. Connectionless protocols do not set up a dedicated end-to-end connection. Communication is achieved by transmitting information in one direction from source to destination without verifying the readiness or state of the receiver.

Unreliable - When a UDP message is sent, it cannot be known if it will reach its destination; it could get lost along the way. There is no concept of acknowledgment, retransmission, or timeout.

Not ordered - If two messages are sent to the same recipient, the order in which they arrive cannot be guaranteed.

Lightweight - There is no ordering of messages, no tracking connections, etc. It is a very simple transport layer designed on top of IP.

Datagrams - Packets are sent individually and are checked for integrity on arrival. Packets have definite boundaries which are honored upon receipt; a read operation at the receiver socket will yield an entire message as it was originally sent.

No congestion control - UDP itself does not avoid congestion. Congestion control measures must be implemented at the application level or in the network.

Broadcasts - being connectionless, UDP can broadcast - sent packets can be addressed to be receivable by all devices on the subnet.

Multicast - a multicast mode of operation is supported whereby a single datagram packet can be automatically routed without duplication to a group of subscribers.

RFC 768 - User Datagram Protocol

RFC 2460 - Internet Protocol, Version 6 (IPv6) Specification

RFC 2675 - IPv6 Jumbograms

RFC 4113 - Management Information Base for the UDP

RFC 8085 - UDP Usage Guidelines

# data[].attributes.attachment_link.description
In computer networking, the User Datagram Protocol ( UDP) is one of the core members of the Internet protocol suite. The protocol was designed by David P. Reed in 1980 and formally defined in RFC 768. With UDP, computer applications can send messages, in this case referred to as , to other hosts on an Internet Protocol (IP) network.

# data[].attributes.attachment_link.readable_text
Any one starting to learn about computer networking will be faced with learning about the OSI and TCP/IP networking models, and the TCP/IP protocol suite.

In this tutorial we will look at networking protocol models, and explain how and why they are structured into layers.

We will then look at the most common protocol suite, the TCP/IP protocol suite and the 4 layer model.

What you will Learn

What are Protocols and what is a protocol suite

Why Protocols use a stack or layer model

The OSI and TCP/IP models

How Protocols work across Networks.

The TCP/IP model ,protocol layers and the main protocols at each layer.

Networking equipment and networking levels

What is a Protocol ?

A protocol is a set of rules that govern how systems communicate. For networking they govern how data is transferred from one system to another.

What is a Protocol Suite ?

A protocol suite is a collection of protocols that are designed to work together.

Before TCP/IP became the de-facto standard other protocol suites like IPX and SPX were common (Novell).

Protocol Stacks

It is possible to write a single protocol that takes data from one computer application and sends it to an application on another computer.- A Single stack Protocol

The problem with this approach is that it very inflexible, as any changes require changing the entire application and protocol software.

The approach used in networking is to create layered protocol stacks.

Each level of the stack performs a particular function and communicates with the levels above and below it.

This layered arrangement is not confined to networking, and how it works is probably best understood if you compare it to real life example.

Lets take an example of a parcel service between two offices.

The task is simple - send parcels between people in each office.

We will divide the task into two distinct processes as follows:

1. Take a package, wrap it and address it.

2. Send it to the destination

at the receiving end

1. Receive the package

2. Deliver it to the recipient

Typically you would have an internal mail man that:

1. Collects the parcels from the senders and takes then to a mail dispatch room.

2. The parcels are placed in a van by the dispatcher and then driven to the remote office.

At the remote office

1. The parcels are received by the dispatcher and placed into a tray for the mail man

2. The mail man collects the parcels and delivers them to the recipients,

Here is a simple diagram to illustrate the process:

The question really is what is the advantage of splitting the task into different layers/tasks?

The answer is that any of the layers/tasks can be changed without affecting the other layers.

So if for example, if we decide to use a train instead of a van to transport the messages between the offices we could do so without affecting the mail man.

In fact the mail man doesn't know, and doesn't care, how the parcels are transported between the offices, as all he does is collect them, and pass them to the delivery man.

Although this appears very simple, and maybe trivial, it does illustrate some very important points that are crucial when it comes to understanding networking protocols and how they are organised.

The OSI and TCP/IP Networking Models

All networking courses teach the 7 layer OSI model.

It is important to understand that this model provides for a conceptual framework, and no modern protocols implement this model fully.

The TCP/IP protocol suite uses a 4 layer model.

Note: The OSI model is an idealised networking model, whereas the TCP/IP model is a practical implementation.

The diagram shows how the TCP/IP and OSI models compare

This article has a good overview of the OSI protocol layers and their functions

What is important to understand is that the interfaces between the interfaces are well defined so that it is theoretically possible to replace a particular protocol with another one that operates at that level.

For example you should theoretically be able to replace the IP networking protocol with the IPX networking protocol without affecting how the application e.g. POP3 works.

Although this doesn't always apply the application protocols like SMTP ,POP3 etc will work Okay across different data link protocols like Ethernet,Token ring etc.

End to End Connections- Routers,Switches and OSI

When two computers communicate across a network the data must travel through various items of networking equipment.

You will often hear the terms level 2 and level 3 equipment used. These terms refer to the OSI levels of the protocol stack that the device operates at.

A router for example works at the networking layer and is a level 3 device.

A switch operates at the Ethernet level and is a level 2 device.

Because a router operates at the networking layer it doesn't need to support the upper layer application protocols like HTTP,FTP etc.

The router works on network address which are part of the networking protocol ( IP or IPX).

A router can route many different protocols at the same time, but it doesn't do protocol conversion.

An IP packet coming in will be an IP packet going out and an IPX packet coming in will be an IPX packet going out.

To do protocol conversion you will need a Gateway.

Likewise a switch doesn't have level 3,4,5,6 or 7 protocol stacks as it doesn't need them, and so it doesn't care about the routing protocol IP,IPX etc or the application FTP,HTTP etc that passes through it.

Because the switch operates at level 2 (data link layer) it only needs to understand the MAC addresses that are part of the Ethernet protocol.

The TCP/IP Protocol Suite

The TCP/IP protocol suite consists of many protocols that operate at one of 4 layers.

The protocol suite is named after two of the most common protocols - TCP (transmission Control Protocol) and IP (internet Protocol).

TCP/IP was designed to be independent of networking Hardware and should run across any connection media.

The earliest use, and the most common use is over Ethernet networks.

Ethernet is a 2 layer protocol/standard covering the physical and data link layer, shown in the diagram above.
Important Notes:
HTTP (hypertext transfer protocol) -This is the workhorse of the Web.

SMTP,POP3,IMap4 - These are email protocols

TCP (Transmission control protocol) is a connection orientated protocol and is used to provides a reliable end to end connection.

UDP (used datagram protocol) is connection less protocol and doesn't guarantee delivery. See UDP vs TCP- what is the Difference?

Applications will choose which transmission protocol to use based on their function. HTTP, POP3, IMAP4, SMTP and many more use TCP.

UDP is used more in utility applications like DNS, RIP (routing information protocol), DHCP.

IP (Internet Protocol) - This is the main networking protocol. There are two version of IP ( IPv4 and IPV6).

ARP (address resolution Protocol) -Translates an IP address to a MAC or physical address.(IP4 networks)

Summary

The TCP/IP protocol suite is a collection of protocols that are used on the Internet.

It is named after two of the main protocols ( TCP and IP) and uses a 4 layer networking model.

Questions?

What's missing from this tutorial? What isn't properly explained? Let me know using the comments section below and help me improve this tutorial..
Related Articles and resources:

# data[].attributes.attachment_link.title
The TCP/IP Model and Protocol Suite Explained for Beginners

# data[].attributes.attachment_link.description
Any one starting to learn about computer networking will be faced with learning about the OSI and TCP/IP networking models, and the TCP/IP protocol suite. In this tutorial we will look at networking protocol models, and explain how and why they are structured into layers.

# data[].attributes.body
Protocols = rules of greeting. In human terms, we have 'etiquette'

If you do not follow the rules then your communication may be cut short or fail.

# data[].attributes.attachment_link.title
Japan Business Etiquett, Vital Cultural Manners: Meishi Kokan (Business Cards)

# data[].attributes.body
You need to learn or follow the expected standard to show respect - as you would expect from

# data[].attributes.attachment_link.title
Chapter Summary :: Chapter 2. Network Models and Standards :: Lan switching first-step :: Networking :: eTutorials.org

# data[].attributes.attachment_link.description
The internetworking environment is governed by two complementary rule sets: standards and models. Standards are the laws that vendors must adhere to if they are to interoperate with other vendors, in turn making themselves available and useful for the end user.

# data[].attributes.attachment_link.readable_text
Both peer-to-peer and client-server networks connect computers so that resources like files and applications can be shared. Peer-to-peer networks connect computers so that each computer shares all or part of its resources. Client-server networks have one or more central computers, or servers, that hold the data and manage resources.

credit: AKodisinghe/iStock/Getty Images

Peer-to-Peer Networks

Peer-to-peer networks involve two or more computers pooling individual resources such as disk drives, DVD players and printers. These shared resources are available to every computer in the network. Each computer acts as both the client and the server, communicating directly with the other computers. On a peer-to-peer network, for example, a printer on one computer can be used by any other computer on the network. These networks are inexpensive to set up. All you need is a way to connect them, like an Ethernet cable or a Wi-Fi router.

Client-Server Networks

A client-server network involves multiple clients, or workstations, connecting to at least one central server. Most data and applications are installed on the server. When clients need access to these resources, they access them from the server. Servers often have private user directories as well as multiple public directories.Client-server networks tend to have faster access speeds because of the large number of clients they are designed to support. The clients are allowed to function as workstations without sharing any resources. It is easier to upgrade software applications and files because they are held on one single computer. System-wide services can be provided through the server software. Security is enhanced on a client server network because the security is handled by the server.

Video of the Day

Disadvantages and Limitations

Peer-to-peer networks are typically less secure than a client-server network because security is handled by the individual computers, not on the network as a whole. The resources of the computers in the network can become overburdened as they have to support not only the workstation user, but also the requests from network users. It is also difficult to provide system-wide services because the desktop operating system typically used in this type of network is incapable of hosting the service. Client-server networks have a higher initial setup cost. It is possible to set up a server on a desktop computer, but it is recommended that businesses invest in enterprise-class hardware and software. They also require a greater level of expertise to configure and manage the server hardware and software.

Software Installation

Peer-to-peer networks require software to connect to each other. If they all use the same operating system, connections are relatively easy -- like connecting two computers using Windows HomeGroup. If the computers use different operating systems, you may need to use additional software before they can communicate. Most of the software required for a client-server network is installed only on the server. Many different types of software including printer drivers, FTP and security software can be installed on a single machine. Client computers only need to have software that enables the computer to connect to the server. Often, the client computers have this software installed by default.

Usage

Due to the security issues and the lack of extensibility, peer-to-peer networks are usually found in homes or small businesses with few security concerns. Client-server networks should be used in environments where growth is expected, security is important and faster access times are required.

# data[].attributes.attachment_link.title
Peer-to-Peer vs. Client-Server Networks | Techwalla.com

# data[].attributes.attachment_link.description
Both peer-to-peer and client-server networks connect computers so that resources like files and applications can be shared. Peer-to-peer networks connect computers so that each computer shares all or part of its resources. Client-server networks have one or more central computers, or servers, that hold the data and manage resources.

# data[].attributes.body
search for shared or token

# data[].attributes.body
search for 'token' or 'shared'

# data[].attributes.attachment_link.title
Fundamentals of Information Systems Security/Telecommunications and Network Security - Wikibooks, open books for an open world

# data[].attributes.attachment_link.description
An internetwork is a collection of individual networks, connected by intermediate networking devices, that functions as a single large network. Internetworking refers to the industry, products, and procedures that meet the challenge of creating and administering internetworks