Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

User Datagram Protocol : IOT Part 30

By Priya

The TCP/IP protocol despite being most common protocol stack on internet is not much suitable for IoT applications due to large overhead. It is more suitable for applications where reliable delivery of data with high bandwidth in hand is required. The IoT applications generally have limited bandwidth and need swift transfer of small data packets. In such case, the UDP/IP stack is far better than TCP/IP.  
The User Datagram Protocol (UDP) is the simplest transportation layer protocol used primarily for establishing low-latency and loss tolerating connections between applications on the communication network. Both TCP and UDP run on the top of Internet Protocol (IP) that is why they are referred as TCP/IP and UDP/IP. 
User Datagram Protocol (UDP)
UDP is a connectionless protocol which means the sender just transmits the data without waiting for the connection with the receiver. It is an unreliable protocol when compared with TCP. There is no error checking mechanism or correcting mechanism involved in data transmission which results in using less bandwidth. UDP protocol just sends the packets (or datagram). There is no acknowledgement guarantee of packet received by the other end. It allows for less data overhead and delays. 
To achieve higher performance, the protocol allows individual packets to be dropped (with no retries) and UDP packets to be received in a different order than they were sent, as dictated by the application.
Features of UDP – 
The UDP protocol stack has the following features – 
1) UDP can be used when acknowledgement of data does not hold any significance.
2) It is great for data flowing in one direction.
3) It is connectionless protocol. 
4) It does not provide any congestion control mechanism.
5) It is a suitable protocol for streaming applications such as video conference applications, computer games etc.
UDP Datagrams –
UDP traffic works through packets called datagram, with every datagram consisting of a single message unit. The header details are stored in the first eight bytes, but the rest is what holds onto the actual message. The UDP datagram header can be divided into four parts each of which is two bytes long. These parts are as follow – 
1) Source Port – This 16 bits (2 bytes) information is used to identify the sender port which will send the data. A valid UDP port number ranges from 0 to 65535. 
2) Destination Port – This 16 bits information is used to identify the receiver’s port on which the data will be received. A valid UDP port number ranges from 0 to 65535. This field identifies the receiver’s port and is required.
3) Length – The length field specifies the entire length of the UDP packet (UDP header and UDP data). This individual field is 16-bits field. The minimum length of the Length field is 8 bytes in case of no UDP data.
4) Checksum  – This field stores the checksum value generated by the sender before sending the data to the receiver. UDP checksums protect message data from being corrupted. The checksum value represents an encoding of the datagram data calculated first by the sender and later by the receiver. In UDP, checksum is optional, as opposed to TCP where checksum is mandatory.
Advantages of UDP – 
The UDP/IP has the following advantages over TCP/IP stack – 
 
1) It is better than TCP for applications that require constant data flow, bulk data and which require more swiftness than reliability.
2) For multicast and broadcast purposes, UDP is best suited because it supports point to multipoint transmission method. The sender does not need to keep track of retransmission of data for multiple receivers in contrast with the TCP/IP where sender needs to take care of each packet.
3) There is small packet header overhead in UDP (only 8 bytes) whereas TCP has 20 bytes of header.
In the next tutorial – Client Server Communication over UDP Protocol, an ESP8266 module is configured as UDP server and a laptop is configured as UDP Client. The UDP Client sends some data to the server and the server acknowledges it by switching an LED on. 

Filed Under: Electronic Projects

 

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What is a loop calibrator? 
  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Measure AC current accurateley (100mA to 10A)
  • 74HC595 creating Fake output
  • What was before microcontrollers ?
  • NEED HELP FOR OP-AMP IN BGR
  • Check undesired substrate mode...

RSS Electro-Tech-Online.com Discussions

  • Sla ir li ion
  • Need a ducted soldering fan for solder smoke extraction
  • Question about ultrasonic mist maker
  • Best way to reduce voltage in higher wattage system?
  • Two 300nH inductor in series, can get higher current?
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering