<<

Source End IP Address IoT Smart Sensor Set of IP TCP/IP Appl. Protocols routers Application Sensor Framework TCP/IP

IoT Comm. Set of IP GatewayGateway Framework routers DataData Destination End IP Address ConsolidationConsolidation FrameworkFramework Data Application SetSet ofof IPIP Framework routersrouters Physical cum data-link layer IoTIoT Comm.Comm. IoT Comm. FrameworkFramework Framework

Source End IP Address SetSet ofof IPIP routersrouters

Fig. 4.1 Source end network layer connected through set of IP routers for data packets from an IP address and communicating with IoT/M2M IoT Apps and Services layer using TCP/IP suite of Application protocols Port for data from or to Application Layer L7 PDU = 232 L7 Header L7 Data Segment B for Data Stack from L7 or to L7 Applicatio UDP ns L4 Header Data for TCP Stream and Services L3 Header Data Stack from L4 or to L4 PDU = 216 B L3 IP packet for the Network

L2Header Data Stack from L3 L2Trailing Bits PDU = 1580 B

Data Stack from L2 (Link Layer) or to L2

Physical Layer L1 Layer

Fig. 4.2 TCI/IP suite four layers model generating data stack for the network, and for during communication 31 16 15 8 7 4 3 0 len [IP Packet Service Type and Service Type and IP length words] Precedence Precedence version 63 51 50 47 46 32 Fragment Offset Flags First Byte Sequence No. in the stream 95 80 79 72 71 64 Check sum Type of Protocol TTL(Time to Live) 127 96 Header Source IP address 159 128 Destination IP address q 160 Extended Option header words and fields plus the words as padding Header before the data q = (32× n 1), [n v q is number of Data of (len  n) words words = 5 words Maximum v = (214  n) × 32  1 for header plus

options plus padding words

Data Packet (stack) from or to Transport layer (Maximum Size 214 words = 216 B

Fig. 4.3 Data stack received or transmitted at or to transport layer, and packet consisting of IP header fields of 160 bits and extended header (n  5) words (when required) plus data stack of maximum v words from or for the transport layer 10s of Bytes of Device IEEE 802.15.4 Device Fragment- IPv6 Link App data 127 B ation Layer Device 1 MTU 1280 B [Bytes IPv6 Header 40 B Device 2 for and from UDP Header8 B network …….. 127 B and IEEE 802.15.4 transport Device 94 B layers] ……… Security21 B

Device MAC ( i1) Header 25 B

Device i App Data 33B Max. 33 Bytes App data at single data Reassembly transfer

Physical/DataLink Layer Adaptation Layer 6LoWPAN Protocol

(a) (b)

Fig. 4.4(a) Physical layer IEEE 802.15.4 network devices (b) Adaptation layer 6LoWPAN protocol 127 B fragmented frames reassembly into IPv6 maximum 1280 B or fragmentation of IPv6 MTU 1280B into 127 B frames for transfer to a device. Application Layer protocols (DNS, Application Layer protocols (HTTPS, TFTP, Bootpc, Bootps, SNMP, DHCP, HTTP, MQTT, XMPP, SOAP, FTP, TFTP, CoAP, LWM2M , PoP3, SMTP)

DTLS TLS Datagram 16 (PDU = 2 B) Segment PDU = 232 B Network Transport UDP Transport Layer TCP Management Datagram Acknowledged data flow stream ND, RPL Packet PDU = 216 B IPv4/ IPv6

PDU = 1 Frame Adaptation ARP/RARP 6LoWPAN, CoAP, LWM2M WiFi/

Fig. 4.5 IoT TCP/IP Suite of Protocols for Internet 31 16 15 0 Destination Port number Source Port number 63 31 First Byte Sequence Number in the stream 95 64 Next expected sequence no. in the Acknowledgement Header

127 112 111 96 w [TCP Byte stream size, len Flags (6-bit), Reserved (6 bit) Extended + n) words] plus data Offset (4-bit) Header 159 144 143 128 qHeader = (32× n  1), [n is urgent [Data End Pointer Check sum number of words = 5 (Location of Byte Stream)] words for header plus q 160 options plus padding Option header words and fields plus the words as words padding before the data v q Data of len words Data stack from v = (n + len) × 32  1 or to Application layer

Fig. 4.6 Data stack received or transmitted at or to transport layer stream consisting of TCP header field 160 bits and extended header (n  5) words when required plus data stack of len words from or for the Application layer 31 0 Source IP address Pseudo Header 63 32 Destination IP address

31 16 15 0 Destination Port number Source Port number Header 63 16 15 32 Length Check Sum (4 × m + 8) B p 64 m words P= (m + 8) × 32  1 Data stack from Application layer

Fig. 4.7 Transport Layer UDP Header field with data stack from the Application layer and Pseudo header of 2 words (64 bits) for source and destination IP addresses Lesson 6 Application Layer Protocols: HTTP, HTTPS and Other Ports

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 8 Publs.: McGraw-Hill Education A TCP/IP message • Sent from specified port at transmission end and to the specified port at the receiver end, else receiver port does not listen

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 9 Publs.: McGraw-Hill Education TCP/IP suite number of Application layer protocols • HTTP, HTTPS, FTP, Telnet and Others • A concept of Port: Each port uses a distinct protocol at an Application layer • A port uses a protocol for sending and receiving messages.

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 10 Publs.: McGraw-Hill Education Application layer HTTP Port • HTTP (Hyper Text Transfer Protocol) • Port number = 80 • HTTP port sends Application data stack at the output to the lower layer using the HTTP protocol • An HTTP web server listens to port 80 only and responds to port 80 only •

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 11 Publs.: McGraw-Hill Education Application layer HTTP Port • Uses a URL for example http://www. mheducation.com/. • Default port taken as 80 for the URL Port number can be specified after the TLD, for example, after .com in URL http://www. mheducation.com:80/.

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 12 Publs.: McGraw-Hill Education HTTPS (HTTP over Secure Socket Layer or TLS) • Port number = 443. An HTTPS port sends a URL, for example, ://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers. • Here, TLD is .org

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 13 Publs.: McGraw-Hill Education https://en.wikipedia.org/wiki/List_ • domain name is wikipedia.org. • Sub domain name is en. • Resource relative URL is /wiki/List_of_TCP_and_UDP_port_numbers

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 14 Publs.: McGraw-Hill Education HTTP Client and Server • HTTP standard protocol • Requests a URL specified web page (resource) • Web-Server sends in response the requested resource • .

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 15 Publs.: McGraw-Hill Education HTTP Client and Server • The HTTP client requests an HTTP server on the Internet • The server responds by sending a response • The response may be with or without processing

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 16 Publs.: McGraw-Hill Education HTTP a Stateless Protocol • An HTTP request assumed a fresh request as per the protocol • No session or sequence number field or no field that is retained in the next exchange • .

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 17 Publs.: McGraw-Hill Education HTTP a Stateless Protocol • A current exchange by an HTTP request independent of the previous exchanges. The later exchanges do not depend on the current one.

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 18 Publs.: McGraw-Hill Education Cookie • A text file which creates during a particular pair of exchanges of HTTP request and response • The creation is either at a CGI or processing program, for example, JavaScript or script or at a client.

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 19 Publs.: McGraw-Hill Education Cookie • A prior exchange may then depend on this cookie • An HTTP state management mechanism

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 20 Publs.: McGraw-Hill Education HTTP a file transfer-like protocol • Used more efficiently than the FTP • On the other hand HTTP no command line overheads

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 21 Publs.: McGraw-Hill Education HTTP Protocol Features

• Very light (a small format) • Speedy as compared to other protocols, such as FTP • Able to transfer any type of data to a client provided it is capable of handling that data.

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 22 Publs.: McGraw-Hill Education HTTP Protocol Features • Based on Object Oriented Programming System (OOPS) • Eight HTTP specific specified methods 1. GET. 2. POST. 3. HEAD. 4. CONNECT. 5. PUT. 6. DELETE. 7. TRACE. 8. OPTIONS

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 23 Publs.: McGraw-Hill Education Summary We learnt • Application Layer Protocols • HTTP • HTTPS • FTP • HTTP Features

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 24 Publs.: McGraw-Hill Education Summary We learnt • Datagram • Rest and RESTful • Hypertext, Hyperlink • XML

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 25 Publs.: McGraw-Hill Education End of Lesson 7on Application Layer Protocols: HTTP, HTTPS, and Other Ports

Chapter-4 L07: "Internet of Things " , Raj Kamal, 2016 26 Publs.: McGraw-Hill Education