How to Specs: Outside and Inside Views. Josh

Similar documents
Politecnico di Milano Advanced Network Technologies Laboratory. Constrained Application Protocol (CoAP)

Embedded Web Services

COMPUTER NETWORK. Homework #2. Due Date: April 12, 2017 in class

Constrained Application Protocol (CoAP) Vilen Looga, M.Sc. Doctoral

Politecnico di Milano Advanced Network Technologies Laboratory. Application Layer Protocols for the IoT

Internet Engineering Task Force (IETF) Updates: 7641, ARM Ltd. K. Hartke. Universitaet Bremen TZI

Constrained Application Protocol (CoAP) Vilen Looga, M.Sc. Doctoral

Internet of Things: An Introduction

Transport Protocols for Networked Games

Problem 7. Problem 8. Problem 9

CSC 4900 Computer Networks: TCP

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

file:///c:/users/hpguo/dropbox/website/teaching/fall 2017/CS4470/H...

ETSI CTI Plugtests Guide First Draft V ( ) IoT CoAP Plugtests; Paris, France; March 2012

Computer Communication Networks Midterm Review

CSE/EE 461 Lecture 16 TCP Congestion Control. TCP Congestion Control

Linux Networking: tcp. TCP context and interfaces

Service oriented Middleware for IoT

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

ETSI CTI Plugtests Guide First Draft V ( ) IoT CoAP Plugtests; Paris, France; March 2012

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Computer Networks. Homework #4: No Grading

ONEM2M TECHNICAL SPECIFICATION

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 30, 2018

COMP 431 Internet Services & Protocols. Transport Layer Protocols & Services Outline. The Transport Layer Reliable data delivery & flow control in TCP

CS519: Computer Networks. Lecture 5, Part 1: Mar 3, 2004 Transport: UDP/TCP demux and flow control / sequencing

Kepware Whitepaper. IIoT Protocols to Watch. Aron Semle, R&D Lead. Introduction

This Specification is provided for future development work within onem2m only. The Partners accept no liability for any use of this Specification.

IoT Roadmap in the IETF. Ines Robles

Problem Set 7 Due: Start of Class, November 2

L12: end to end layer

RSC Part III: Transport Layer 3. TCP

Introduction to Networks and the Internet

Distributed Pub/Sub Model in CoAP-based Internet-of-Things Networks

Lightweight Internet Protocols for Web Enablement of Sensors using Constrained Gateway Devices

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

CS450 Introduc0on to Networking Lecture 14 TCP. Phu Phung Feb 13, 2015

ESR Consortium LWM2M-MQTT-1.0

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

Topics. TCP sliding window protocol TCP PUSH flag TCP slow start Bulk data throughput

Intro to LAN/WAN. Transport Layer

ESR Consortium LWM2M-MQTT-1.0

Wireless Sensor Networks Module 3: Application Protocol CoAP

Chapter III: Transport Layer

Computer Networking Introduction

onem2m-ts-0008-coap Protocol Binding-V CoAP Protocol Binding Technical Specification

Correcting mistakes. TCP: Overview RFCs: 793, 1122, 1323, 2018, TCP seq. # s and ACKs. GBN in action. TCP segment structure

An Issue in NewReno After Fast Recovery. Yoshifumi Nishida

TCP (Part 2) Session 10 INST 346 Technologies, Infrastructure and Architecture

CSCE 463/612 Networks and Distributed Processing Spring 2017

Section #6 Handout. B has processed this packet and updated its position of its sliding window. Everything is in terms of bytes.

Transport Layer: outline

Wireless Sensor Networks Module 3: Application Protocol - CoAP

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

Communication Networks

This sequence diagram was generated with EventStudio System Designer (

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

Computer Networking Introduction

Transport Layer: Outline

10 minutes survey (anonymous)

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

CSE 4213: Computer Networks II

ETSI CTI Plugtests Guide Draft V0.0.5 ( ) IoT CoAP Plugtests; Las Vegas, USA; November 2013

CS 43: Computer Networks. 15: Transport Layer & UDP October 5, 2018

CS Lecture 1 Review of Basic Protocols

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 11, 2018

Computer Communication Networks Midterm Review

ARM IoT Tutorial. CoAP: The Web of Things Protocol Zach Shelby. April 30 th, 2014

CSCI Topics: Internet Programming Fall 2008

Chapter 3- parte B outline

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

TCP Congestion Control 65KB W

CS 4390 Computer Networks. Pointers to Corresponding Section of Textbook

Chapter 3 Review Questions

Reliable Transport I: Concepts and TCP Protocol

90 Minute Optimization Life Cycle

CNT 6885 Network Review on Transport Layer

Mid Term Exam Results

Chapter 3 Transport Layer

CSCI Topics: Internet Programming Fall 2008

6.033 Computer System Engineering

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

Chapter 3 Transport Layer

Routers. Session 12 INST 346 Technologies, Infrastructure and Architecture

CSCD 330 Network Programming

ECE 610: Homework 4 Problems are taken from Kurose and Ross.

Evaluating the Performance of CoAP, MQTT, and HTTP in Vehicular Scenarios

ECE 435 Network Engineering Lecture 10

15-441: Computer Networks Homework 3

CS244a: An Introduction to Computer Networks

Lecture 5. Transport Layer. Transport Layer 1-1

Development of reliable protocol Sliding window protocols. C = channel capacity in bps I = interrupt/service time + propagation delay

4. What is the sequence number of the SYNACK segment sent by spinlab.wpi.edu to the client computer in reply to the SYN? Also Seq=0 (relative

CSC 401 Data and Computer Communications Networks

TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581

CS 43: Computer Networks. 18: Transmission Control Protocol October 12-29, 2018

Internet Draft Intended status: Standards Track Expires: January 16, 2019 D. Xiong Chongqing University of Posts and Telecommunications July 15, 2018

Computer Networks. Homework #3: Due 11 November 2015 (Wednesday) Just before Midterm#2!

Transcription:

How to Specs: Outside and Inside Views Josh Larson @mutatedshrimp

Software Has Two Sides

Software Has Two Sides

Software Has Two Sides An Inside

Software Has Two Sides An Inside And An Outside

Software Has Two Sides An Inside How it works And An Outside

Software Has Two Sides An Inside How it works And An Outside What it does

Reflected In Code Organization Inside Outside

Reflected In Code Organization Inside (/src) Outside

Reflected In Code Organization Inside (/src) Outside public static int[] factorize(int input) { int[] result = []; for(int fact = 2; input > 1; fact++) { while(input % fact == 0) { result.add(fact); } } return fact; }

Reflected In Code Organization Inside (/src) Outside (/test) public static int[] factorize(int input) { int[] result = []; for(int fact = 2; input > 1; fact++) { while(input % fact == 0) { result.add(fact); } } return fact; }

Reflected In Code Organization Inside (/src) public static int[] factorize(int input) { int[] result = []; for(int fact = 2; input > 1; fact++) { while(input % fact == 0) { result.add(fact); } } return fact; } Outside (/test) @Test public void testtwo() { assertequals([2], factorize(2)); } /*... */ @Test public void testthreefifty() { assertequals([2, 5, 5, 7], factorize(350); }

Reflected In System Architecture

Reflected In System Architecture

Reflected In System Architecture???

Reflected In System Architecture???

Reflected In System Architecture??? filter

Reflected In System Architecture??? filter map reduce

Reflected In System Architecture???!!! filter map reduce

Reflected In System Architecture???!!! filter map reduce

Reflected In System Architecture Frontend Backend???!!! filter map reduce

Reflected In System Architecture Frontend Backend???!!! filter map reduce Outside Inside

This all applies to specs, too!

Examples from the CoAP Spec https://tools.ietf.org/html/rfc7252

Context Interlude CoAP: Constrained Application Protocol Request/Response model Similar operations as HTTP Works over UDP Optimized for low-power devices

Context Interlude CoAP: Constrained Application Protocol Request/Response model Similar operations as HTTP Almost, but not entirely unlike. (https://tools.ietf. org/html/rfc7252#ref-hhgttg) Works over UDP Optimized for low-power devices

Context Interlude CoAP: Constrained Application Protocol Request/Response model Yes, the CoAP spec references the Hitchhiker s Guide to the Galaxy. Yes, this makes me very, very happy. Similar operations as HTTP Almost, but not entirely unlike. (https://tools.ietf. org/html/rfc7252#ref-hhgttg) Works over UDP Optimized for low-power devices

It doesn t make him happy though http://wallpoper.com/images/00/21/19/11/movie-hitchhikers-guide-to-the-galaxy_00211911.

Quiz Time!

Inside or Outside View? 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Ver T TKL Code Message ID +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Token (if any, TKL bytes)... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Options (if any)... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 1 1 1 1 1 1 1 Payload (if any)... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 7: Message Format

Inside or Outside View? 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Ver T TKL Code Message ID +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Inside Token (if any, TKL bytes)... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Options (if any)... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 1 1 1 1 1 1 1 Payload (if any)... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 7: Message Format

Inside View! This has all the trappings of an inside view! Details about how the UDP packet is laid out No context about what the Token, or TKL, or Options, etc, are Necessary for implementers Can be ignored by users

Inside or Outside View? Client Server Client Server CON [0xbc90] CON [0xbc91] GET /temperature GET /temperature (Token 0x71) (Token 0x72) +-----------------> +-----------------> ACK [0xbc90] ACK [0xbc91] 2.05 Content 4.04 Not Found (Token 0x71) (Token 0x72) "22.5 C" "Not found" <-----------------+ <-----------------+ Figure 7: Two GET Requests with Piggbacked Responses

Inside or Outside View? Client Server Client Server CON [0xbc90] CON [0xbc91] GET /temperature GET /temperature (Token 0x71) (Token 0x72) +-----------------> +-----------------> Outside ACK [0xbc90] ACK [0xbc91] 2.05 Content 4.04 Not Found (Token 0x71) (Token 0x72) "22.5 C" "Not found" <-----------------+ <-----------------+ Figure 7: Two GET Requests with Piggbacked Responses

Outside View! Shows two use cases Shows some examples of responses that can come back from a GET request

Outside View! Shows two use cases Shows some examples of responses that can come back from a GET request Shows tokens and message ID s and CON/ACK s

Outside View! Shows two use cases Shows some examples of responses that can come back from a GET request Shows tokens and message ID s and CON/ACK s? Let s look again

Inside or Outside? Client Server Client Server CON [0xbc90] CON [0xbc91] GET /temperature GET /temperature (Token 0x71) (Token 0x72) +-----------------> +-----------------> ACK [0xbc90] ACK [0xbc91] 2.05 Content 4.04 Not Found (Token 0x71) (Token 0x72) "22.5 C" "Not found" <-----------------+ <-----------------+ Figure 7: Two GET Requests with Piggbacked Responses

This View Is Mixed Outside Sample Interactions Request Methods Response Codes Inside Message Details Tokens Message ID s

An Outside View Is One That a User Might Care About

Outside CoAP Views Methods are GET, POST, PUT, and DELETE GET does and guarantees POST does and doesn t promise Response codes look like 2.05 or 4.04, and they mean

Advanced Outside CoAP Views CON guarantees acknowledgement of receipt, even if a response is slow. That acknowledgement comes in the form of an ACK. NON does not have that guarantee.

An Inside View Is One That An Implementer Needs, But a User Can Ignore

Inside CoAP Views Bits 8-15 determine the code. For instance 10000100 means Not Found, and 00000011 is a PUT request. On sending a CON, the sender must resend, using exponential back-off, until it receives an ACK with the same message ID (bits 16-31), or until some timeout is reached. On receiving a repeat CON (repeat determined by the message ID), the receiver must not re-apply the command, but must send the same response it sent the first time.

Inside or Outside? On receipt of a CON, if handling the request is fast, the receiver may send the response message inside the ACK, rather than sending the response as a separate message. Client Server Client Server CON/GET CON/GET +------> versus +------> ACK ACK/205 <------+ <------+ CON/205 <------+ ACK +------>

Inside or Outside? On receipt of a CON, if handling the request is fast, the receiver may send the response message inside the ACK, rather than sending the response as a separate message. Client Server Client Server CON/GET Inside CON/GET +------> versus +------> ACK ACK/205 <------+ <------+ CON/205 <------+ ACK +------>

Inside Views... Include Optimizations That CoAP can Piggyback responses is an optimization. It does not impact how the end-user will use the protocol at all.

Proposal: In Any Spec, Put All of the Inside View Material First

What Would the CoAP Spec look like?

CoAP Spec The Outside View: Request/Response Model: The requests are GET, etc For a GET, you must provide a URI, and optionally, you may provide The valid responses to a GET request are If you are an expert user, you may want to avoid bandwidth and send messages as NON instead of CON.

At This Point, The One Using a CoAP Library Can Stop Reading

CoAP Spec, Continued... Bytes 8-16 signify the request or response code. Valid values are:...and the rest +------+--------+-----------+ Code Name Reference +------+--------+-----------+ 0.01 GET [RFC7252] 0.02 POST [RFC7252] 0.03 PUT [RFC7252] 0.04 DELETE [RFC7252] +------+--------+-----------+

Questions?