n groups of 1,2 or 3 people n if seats are available, also 1 person per group is also fine n individual written report discussed during the oral exam

Size: px
Start display at page:

Download "n groups of 1,2 or 3 people n if seats are available, also 1 person per group is also fine n individual written report discussed during the oral exam"

Transcription

1 Copyright Omnet++ laboratories Paolo Giaccone Quest opera è protetta dalla licenza Creative Commons NoDerivs-NonCommercial. Per vedere una copia di questa licenza, consultare: oppure inviare una lettera a: Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. This work is licensed under the Creative Commons NoDerivs-NonCommercial License. To view a copy of this license, visit: or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA TLC Network Group - Politecnico di Torino 1 TLC Network Group - Politecnico di Torino 2 Lab organization l every Friday 14:30-17:30 l LAIB 2B (14/11, 21/11), LAIB 5D (28/11, 5/12, 12/12, 19/12, 9/1) l based on VDI (Virtual Desktop Virtualization) l l you access a Virtual Machine (VM) running in Polito datacenter you can start your VM anytime from any LAIB PC l not running from outside Politecnico Lab organization n groups of 1,2 or 3 people n if seats are available, also 1 person per group is also fine n individual written report discussed during the oral exam n mandatory writing the report (one for each group) to pass the exam n not mandatory attend the laboratory n plagiarism is forbidden and punished n discussion and interaction among students are welcome TLC Network Group - Politecnico di Torino 4 M/M/1 Lab #2 n Omnet++ implementation n templates n dummy.ned n dummy.cc TLC Network Group - Politecnico di Torino 5 TLC Network Group - Politecnico di Torino 6 1

2 dummy.ned dummy.cc simple Dummy { parameters: gates: input in; output out; network DummyNet { submodules: node1: Dummy; node2: Dummy; connections: node1.out --> node2.in; node2.out --> node1.in; TLC Network Group - Politecnico di Torino 7 #include <string.h> #include <omnetpp.h> class Dummy : public csimplemodule { private: // local variable public: // constructor Dummy(); // constructor virtual~ Dummy(); // destructor protected: virtual void initialize(); virtual void finish(); virtual void handlemessage(cmessage *msg); ; Define_Module(Dummy); TLC Network Group - Politecnico di Torino 8 dummy.cc Statistical collections Dummy::Dummy() { // init all msgs to NULL Dummy::~Dummy() { // delete messages with cancelanddelete() void Dummy::initialize() { // Initialize variables. void Dummy::finish() { // finish void Dummy::handleMessage(cMessage *msg) { // main function to code n Two approaches n signal mechanism, using declared statistics n not covered here n more flexible n using the simulation library n data collection n to get some statistical meaurement n e.g., average, std_dev n data sampling n to get the time evolution of a quantity TLC Network Group - Politecnico di Torino 9 TLC Network Group - Politecnico di Torino 10 Data collection Data sampling cstddev stat("stat"); for (int i=0; i<10; i++) stat.collect( normal(0,1) ); long numsamples = stat.getcount(); double smallest = stat.getmin(), largest = stat.getmax(); double mean = stat.getmean(), standarddeviation = stat.getstddev(), variance = stat.getvariance(); TLC Network Group - Politecnico di Torino 11 n coutvector class Sink : public csimplemodule { protected: coutvector endtoenddelayvec; ; void Sink::initialize() { endtoenddelayvec.setname("end-to-end Delay"); void Sink::handleMessage(cMessage *msg) { simtime_t eed = simtime()-msg->getcreationtime(); endtoenddelayvec.record(eed); delete msg; TLC Network Group - Politecnico di Torino 12 2

3 Statistical results n Available under results/ n Accessible through n scavetool scalar n scavetool vector Lab #3 TLC Network Group - Politecnico di Torino 13 TLC Network Group - Politecnico di Torino 14 Packets n cpacket extends cmessage class n support for TLC network packets n packet length n transmission time on a channel with a datarate n packet error on a channel with error probability n encapsulation (recursive) TLC Network Group - Politecnico di Torino 15 Creation of a packet void Generator::handleMessage(cMessage *msg) { cpacket *pkt; simtime_t departure_time; // create new packet pkt = new cpacket("packet"); // set its size pkt->setbytelength((long)par("pktsizebytes")); // sent to the output send(pkt,"out"); // compute the new departure time departure_time=simtime()+par("interarrivaltime"); // schedule the new packet generation scheduleat(departure_time, sendmsgevent); TLC Network Group - Politecnico di Torino 16 Channel with datarate n in ned file: network Ethernet { connections: mod1.out --> {datarate=100mbps;delay=1us; --> mod2.in; Channel offered load n arrival rate r [s -1 ] n average interarrival time T [s] n average pkt size P [bit] n datarate v [bit/s] n offered load= rp/v = P/(vT) n in [0,1] to be admissible TLC Network Group - Politecnico di Torino 17 TLC Network Group - Politecnico di Torino 18 3

4 Transmission model n transmission and propagation delays n Channel with datarate gettransmissionfinishtime() of cchannel class n for transmission channels, returns the simulation time the sender gate will finish transmitting n in handle_message() TLC Network Group - Politecnico di Torino 19 // declarations cchannel *txchannel=gate("out )-> gettransmissionchannel(); simtime_t txfinishtime; send(msg, out ); // compute the end of transmission of the current pkt txfinishtime = txchannel->gettransmissionfinishtime(); // evaluate the transmission delay (only if needed) transmission delay = txfinishtime-simtime() TLC Network Group - Politecnico di Torino 20 Transmitting a packet n in handlemessage if msg is end-of-tx event if another packet is available in the queue remove the packet from tx queue send packet schedule end-of-tx event at txfinishtime if msg is a packet if the channel is free (i.e., end-of-tx not scheduled) send packet schedule end-of-tx event at txfinishtime else store the pkt in the tx queue Trasmitting a packet n note that in the previous code, the intransmission packet is not (anymore) in the queue n it possible to modify the code to keep the packet inside the queue until the packet is completely transmitted TLC Network Group - Politecnico di Torino 21 TLC Network Group - Politecnico di Torino 22 Message casting n n dynamic_cast allows to adapt a pointer to the derived/base class cpacket is a derived class from cmessage void Sink::handleMessage(cMessage *msg) { // msg->getbytelength() NOT VALID cpacket *pkt; pkt=check_and_cast<cpacket *>(msg); // equivalent (but safer!) to pkt=(cpacket *)msg; // now you can use for the same received packet EV << "Bytes "<<pkt->getbytelength()<<endl; EV << Creation time <<msg->getcreationtime()<<endl; Lab #4 TLC Network Group - Politecnico di Torino 23 TLC Network Group - Politecnico di Torino 24 4

5 Packet scheduler n pkt is enqueued based on the arrival gate n scheduling decision n Round Robin n Strict Priority Arrival gate of a msg n ArrivedOn(gatename) method of cmessage to understand if the msg arrived from a specific gate void MyModule::handleMessage(cMessage *msg) { if (msg->arrivedon( in1 )) { // do something // e.g. store into the correct queue queue1.insert(msg); TLC Network Group - Politecnico di Torino 25 TLC Network Group - Politecnico di Torino 26 Scheduling decision SP Scheduler if msg is end-of-tx event q=scheduler() // choose the tx-queue to serve // q=0 -> all tx-queues are empty // q=1 -> serve tx-queue1 // q=2 -> serve tx-queue2 if q>=1 // if a non-empty queue was chosen remove the packet from tx-queue q send packet schedule end-of-tx event at txfinishtime if msg is a packet if end-of-tx not scheduled (i.e., free channel) send packet schedule end-of-tx event at txfinishtime else store the pkt into the proper tx-queue // high priority to tx-queue1 int scheduler() if tx-queue1 is not empty return 1 else if tx-queue2 is not empty return 2 else // both queues are empty return 0 TLC Network Group - Politecnico di Torino 27 TLC Network Group - Politecnico di Torino 28 RR Scheduler Personalized packet format last_queue_served is a private variable of the class int scheduler() if (last_served_queue==1) if (tx-queue2 is not empty) last_served_queue=2 return 2 else if (tx-queue1 is not empty) return 1 else return 0 else // last_served_queue==2 if (tx-queue1 is not empty) last_served_queue=1 return 1 else if (tx-queue2 is not empty) return 2 else return 0 TLC Network Group - Politecnico di Torino 29 n create a new file MyPacket.msg packet MyPacket { int sourceid; ; n pre-compile with opp_makemake f n creates MyPacket_m.h and MyPacket_m.cc n now, a new derived class from cpacket is available with name MyPacket n new available methods declared in MyPacket_m.h TLC Network Group - Politecnico di Torino 30 5

6 Personalized packet usage n to use in some.cc #include MyPacket_m.h n to create a new packet MyPacket *mypkt; mypkt = new MyPacket("packet"); n to set/get the sourceid mypkt->setsourceid(int value); EV<< mypkt->getsourceid(); n since it is a derived class from cpacket, it inherits all the methods mypkt->setbytelength(); // from cpacket if (mypkt->isscheduled()); // from cmessage TLC Network Group - Politecnico di Torino 31 Lab #5 TLC Network Group - Politecnico di Torino 32 Lossy channels n a bit error probability (ber) or a packet error probability (per) can be associated to a link n in ned file: network Ethernet { connections: mod1.out --> {datarate=100mbps;delay=5us;per= > mod2.in; Packet loss detection n at the receiver, hasbiterror() method of cpacket to check whether the packet has been received void Receiver::handleMessage(cMessage *msg) { // cast the msg into a packet // (assuming that it is possible) cpacket *pkt; pkt=check_and_cast<cpacket *>(msg); if (pkt->hasbiterror()) { // drop packet else { // manage a correctly received packet TLC Network Group - Politecnico di Torino 33 TLC Network Group - Politecnico di Torino 34 Go back N n at the tx n tx_window n base_seq -> min pkt id not yet acked n current_seq -> current pkt in tx n max_seq -> max pkt id not yet acked n at the rx n requested_seq -> id of the next pkt to receive n cumulative ack Receiver if received pkt has errors loose pkt else // pkt is correct if the pkt corresponds to requested_seq // pkt is accepted requested_seq++ send ack (requested_id) else // unexpected pkt discard pkt send ack (requested_id) TLC Network Group - Politecnico di Torino 35 TLC Network Group - Politecnico di Torino 36 6

7 Transmitter: end-of-tx if msg is end-of-tx // check if another transmission is possible // according to the current window if (current_seq<max_seq) // tx a new pkt current_seq++ transmit pkt with current_seq id schedule end-of-tx at txfinishtime reset timer TLC Network Group - Politecnico di Torino 37 Transmitter: ack - 1/2 if msg is an ack for ack_seq if ack is corrupted drop ack return // update the window base_seq=ack_seq max_seq=base_seq+tx_window-1 // check if end of file if (ack_seq>=file_size_in_pkts) // end the simulation and call finish endsimulation() // delete the pkt delete ack [continue on the following slide] TLC Network Group - Politecnico di Torino 38 Transmitter: ack 2/2 [continue from the previous slide] // if tx is idling, tx a new pkt if end-of-tx is not scheduled current_seq++ transmit pkt with current_seq id schedule end-of-tx at txfinishtime reset timer Transmitter: timeout if msg is timeout // restart to transmit from the beginning in window current_seq=base_seq-1 if end-of-tx is not scheduled // i.e. tx is idling // tx a new pkt current_seq++ transmit pkt with current_seq id schedule end-of-tx at txfinishtime reset timer TLC Network Group - Politecnico di Torino 39 TLC Network Group - Politecnico di Torino 40 Reset timer // if the timeout is still in the FES, remove it if (timeoutevent->isscheduled()) cancelevent(timeoutevent) // schedule a new timeout scheduleat(simtime()+timeout, timeoutevent); Lab #6 TLC Network Group - Politecnico di Torino 41 TLC Network Group - Politecnico di Torino 42 7

8 Wireless channel Possible simulator design n radio channel is shared medium n wireless communication is broadcast n not directly supported by Omnet++ n possible solution n central module (RX) responsible to manage the state of the channel and to detect interference among transmissions TX1 RX TX1 TX1 TLC Network Group - Politecnico di Torino 43 TLC Network Group - Politecnico di Torino 44 Possible simulator design n TX module n transmits a control message (START-RX) to RX to notify the start-of-reception n transmits a control message (END-RX) to RX to notify the end-of-reception Transmitter module of TX if msg is endtxevent, then dequeue pkt create END-RX control message send END-RX to RX at propagation-delay from now try to transmit from the queue if msg is a packet, then enqueue the pkt if server idling, then try to transmit from the queue TLC Network Group - Politecnico di Torino 45 TLC Network Group - Politecnico di Torino 46 Transmitter module Receiver module // function: try-to-transmit from the queue if queue is not empty compute the tx-time of the packet in front of queue schedule endtxevent at tx-time from now create the control message START-RX send START-RX to RX at propagation-delay from now if msg is START-RX num_contemporary_rx++ if (num_contemporary_rx==1) good_rx=true // maybe good reception else good_rx=false // interference! if msg is END-TX if (num_contemporary_rx==1 && good_rx) // packet has been received correctly! else // packet has been lost TLC Network Group - Politecnico di Torino 47 TLC Network Group - Politecnico di Torino 48 8

9 Direct sending - NED simple TXModule { gates: output simple ChannelModule { gates: input Direct sending C++ n at the transmitter // identify the receiver moduler cmodule *rxmodule = getparentmodule()->getsubmodule( channel"); // transmit directly to the radioin gate of channel module senddirect(msg,rxmodule,"radioin"); // or senddirect(msg,propagation_delay,datarate,rxmodule,"radioin"); // where datarate is considered only for cpacket *msg n at the receiver msg->getsendermoduleid() returns the id (integer value) of the sending module TLC Network Group - Politecnico di Torino 49 TLC Network Group - Politecnico di Torino 50 Control messages n it is possible to identify the kind of message/ packet with method setkind() and getkind() // EXAMPLES: // at TX, choose the kind of msg msg->setkind(1) // for START-RX msg->setkind(2) // for END-RX // at RX, identify the kind of msg if (msg->getkind()==1) { // START_RX else if (msg->getkind()==2) { // END-RX C++ STL map n To evaluate statistics, it may be possible to exploit map data structures available in C++ standard template library // Declaration std::map<int,long>num_rx_packets; // Update information for key 312 num_rx_packets[312]=num_rx_packets[312]+1 Key-1 Value-1 Key-2 Value-2 Key-3 Value-3 // Retrieve all the values in the map std::map<int,long>::iterator it; for (it=num_rx_packets.begin(); it!=num_rx_packets.end(); it++) { EV << key << it->first << value <<it->second<<endl; TLC Network Group - Politecnico di Torino 51 TLC Network Group - Politecnico di Torino 52 9

Introduction to Omnet++

Introduction to Omnet++ Introduction to Omnet++ Paolo Giaccone paolo.giaccone@polito.it TLC Network Group - Politecnico di Torino 1 Copyright Quest opera è protetta dalla licenza Creative Commons NoDerivs-NonCommercial. Per vedere

More information

COMPUTER NETWORKS - Window protocols

COMPUTER NETWORKS - Window protocols ARQ techniques (window protocols) Gruppo Reti TLC nome.cognome@polito.it http://www.telematica.polito.it/ Copyright Quest opera è protetta dalla licenza Creative Commons NoDerivs-NonCommercial. Per vedere

More information

COMPUTER NETWORKS - Window protocols

COMPUTER NETWORKS - Window protocols ARQ techniques (window protocols) Gruppo Reti TLC nome.cognome@polito.it http://www.telematica.polito.it/ COMPUTER NETWORKS Window protocols - 1 Copyright Quest opera è protetta dalla licenza Creative

More information

COMPUTER NETWORKS - Local area networks

COMPUTER NETWORKS - Local area networks Local area networks Telecommunication Networks Group firstname.lastname@polito.it http://www.telematica.polito.it/ COMPUTER NETWORKS LANs - 1 Copyright Quest opera è protetta dalla licenza Creative Commons

More information

Local area networks. Copyright

Local area networks. Copyright Local area networks Telecommunication Networks Group firstname.lastname@polito.it http://www.telematica.polito.it/ COMPUTER NETWORKS LANs - 1 Copyright Quest opera è protetta dalla licenza Creative Commons

More information

LAN interconnection. Telecommunication Networks Group

LAN interconnection. Telecommunication Networks Group LAN interconnection Telecommunication Networks Group firstname.lastname@polito.it http://www.telematica.polito.it/ COMPUTER NETWORKS - LAN interconnection- 1 Copyright Quest opera è protetta dalla licenza

More information

IEEE standards for local area networks

IEEE standards for local area networks IEEE standards for local area networks Telecommunication Networks Group firstname.lastname@polito.it http://www.telematica.polito.it/ COMPUTER NETWORKS Standard for LANs 1 Copyright Quest opera è protetta

More information

OMNeT++ - Tutorial 3. Brian Ricks Wireless Network Security Spring 2014

OMNeT++ - Tutorial 3. Brian Ricks Wireless Network Security Spring 2014 OMNeT++ - Tutorial 3 Brian Ricks Wireless Network Security Spring 2014 Where we left off Creating / running a simulation Batch simulations More analysis Chuck Norris What Now? Chuck Norris Write your own

More information

AP Management and Handover support (802.11f)

AP Management and Handover support (802.11f) AP Management and Handover support (802.11f) Renato Lo Cigno http://disi.unitn.it/locigno/index.php/teaching-duties/nomadiccommunications ...Copyright Quest opera è protetta dalla licenza Creative Commons

More information

Data link layer (layer 2)

Data link layer (layer 2) Data link layer (layer 2) Gruppo Reti TLC nome.cognome@polito.it http://www.telematica.polito.it/ COMPUTER NETWORK DESIGN Review of layer 2 protocols - 1 Copyright Quest opera è protetta dalla licenza

More information

Simulation. Faking reality: How? 1) Pretending the causes 2) Faking the effects 3) Trying to obtain the same output (red card)

Simulation. Faking reality: How? 1) Pretending the causes 2) Faking the effects 3) Trying to obtain the same output (red card) Simulation Faking reality: How? 1) Pretending the causes 2) Faking the effects 3) Trying to obtain the same output (red card) 1 Observing reality Modeling Implementation Scenario Creation Overview 2 2

More information

Chang-Gun Lee Assistant Professor The School of Computer Science and Engineering Seoul National University

Chang-Gun Lee Assistant Professor The School of Computer Science and Engineering Seoul National University Queueing Simulation with OMNet++ Chang-Gun Lee (cglee@snu.ac.kr) Assistant Professor The School of Computer Science and Engineering Seoul National University Single Queue System - Modules and Connections

More information

Review of fundamentals networking concepts

Review of fundamentals networking concepts Review of fundamentals networking concepts Andrea Bianco Paolo Giaccone Telecommunication Networks Group firstname.lastname@polito.it http://www.telematica.polito.it/ Computer Network Design - 1 Copyright

More information

Telematics 2 & Performance Evaluation

Telematics 2 & Performance Evaluation Telematics 2 & Performance Evaluation Chapter 8 OMNeT++ A Tool for Simulation Programming (Acknowledgement: These slides have been prepared by Prof. Dr. Holger Karl) 1 Goals of this chapter q The previous

More information

Middleware Lab 01 : Introduction to OMNeT++

Middleware Lab 01 : Introduction to OMNeT++ Middleware Lab 01 : Introduction to OMNeT++ Guillaume-Jean Herbiet October 31, 2008 Abstract This first lab aims at discovering event-based discrete network simulation and the

More information

Practical Discrete Event Simulation and The Python Simulator

Practical Discrete Event Simulation and The Python Simulator Practical Discrete Event Simulation and The Python Simulator Michele Segata, Renato Lo Cigno ANS Group DISI University of Trento, Italy http://disi.unitn.it/locigno/index.php/teaching- duties/spe A little

More information

Multimedia Communication Services Traffic Modeling and Streaming

Multimedia Communication Services Traffic Modeling and Streaming Multimedia Communication Services Medium Access Control algorithms Simulation of AlohaNet (not slotted) with finite number of nodes Università degli Studi di Brescia A.A. 2014/2015 Francesco Gringoli Master

More information

Chang-Gun Lee Assistant Professor The School of Computer Science and Engineering Seoul National University

Chang-Gun Lee Assistant Professor The School of Computer Science and Engineering Seoul National University OMNet++ What already exist Chang-Gun Lee (cglee@snu.ac.kr) Assistant Professor The School of Computer Science and Engineering Seoul National University Comprehensive Documents OMNet++ 3.2 Manual (not 3.3.

More information

Bluetooth. Renato Lo Cigno

Bluetooth. Renato Lo Cigno Bluetooth Renato Lo Cigno www.dit.unitn.it/locigno/teaching ...Copyright Quest opera è protetta dalla licenza Creative Commons NoDerivs- NonCommercial. Per vedere una copia di questa licenza, consultare:

More information

Lecture 7: Flow Control"

Lecture 7: Flow Control Lecture 7: Flow Control" CSE 123: Computer Networks Alex C. Snoeren No class Monday! Lecture 7 Overview" Flow control Go-back-N Sliding window 2 Stop-and-Wait Performance" Lousy performance if xmit 1 pkt

More information

Simulative Evaluation of Internet Protocol Functions

Simulative Evaluation of Internet Protocol Functions Simulative Evaluation of Internet Protocol Functions Chapter 4 Overview of the protsim Framework Simulation Project (WS 2005): 04 Overview of the protsim Framework 1 Introduction A semester may look like

More information

Simulative Evaluation of Internet Protocol Functions

Simulative Evaluation of Internet Protocol Functions Simulative Evaluation of Internet Protocol Functions Chapter 3 Introduction to OMNet++ (Acknowledgement: These slides have been prepared by H. Karl [Karl04]) Simulation Project (WS 2005): 03 Introduction

More information

Introduction to OMNeT++

Introduction to OMNeT++ Introduction to OMNeT++ Acknowledgment The source material for this presentation was borrowed from the OMNeT++ User Manual Version 4.1 What is OMNeT++ OMNeT++ is an object-oriented modular discrete event

More information

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture)

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture) Lecture 7: Sliding Windows CSE 123: Computer Networks Geoff Voelker (guest lecture) Please turn in HW #1 Thank you From last class: Sequence Numbers Sender Receiver Sender Receiver Timeout Timeout Timeout

More information

Data Link Control Protocols

Data Link Control Protocols Protocols : Introduction to Data Communications Sirindhorn International Institute of Technology Thammasat University Prepared by Steven Gordon on 23 May 2012 Y12S1L07, Steve/Courses/2012/s1/its323/lectures/datalink.tex,

More information

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due NOW!

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due NOW! CSE 123: Computer Networks Alex C. Snoeren HW 1 due NOW! Automatic Repeat Request (ARQ) Acknowledgements (ACKs) and timeouts Stop-and-Wait Sliding Window Forward Error Correction 2 Link layer is lossy

More information

CHAPTER 3 EFFECTIVE ADMISSION CONTROL MECHANISM IN WIRELESS MESH NETWORKS

CHAPTER 3 EFFECTIVE ADMISSION CONTROL MECHANISM IN WIRELESS MESH NETWORKS 28 CHAPTER 3 EFFECTIVE ADMISSION CONTROL MECHANISM IN WIRELESS MESH NETWORKS Introduction Measurement-based scheme, that constantly monitors the network, will incorporate the current network state in the

More information

CSCI Spring Final Exam Solution

CSCI Spring Final Exam Solution CSCI 4211 16Spring Final Exam Solution 1. When an IP packet arrives a router, how the router decides what is the next router (output link) this packet to be forwarded to? What are the routing table and

More information

Final Exam Solutions May 11, 2012 CS162 Operating Systems

Final Exam Solutions May 11, 2012 CS162 Operating Systems University of California, Berkeley College of Engineering Computer Science Division EECS Spring 2012 Anthony D. Joseph and Ion Stoica Final Exam May 11, 2012 CS162 Operating Systems Your Name: SID AND

More information

Service Differentiation and QoS in WLANs (802.11e) Renato Lo Cigno

Service Differentiation and QoS in WLANs (802.11e) Renato Lo Cigno Service Differentiation and QoS in WLANs (802.11e) Renato Lo Cigno www.disi.unitn.it/locigno/ ...Copyright Quest opera è protetta dalla licenza Creative Commons NoDerivs-NonCommercial. Per vedere una copia

More information

Energy Consumption Investigations in WSN using OMNeT++

Energy Consumption Investigations in WSN using OMNeT++ Energy Consumption Investigations in WSN using OMNeT++ Espen Nilsen, master thesis spring 2013 Energy Consumption Investigations in WSN using OMNeT++ Espen Nilsen 15th May 2013 ii Abstract Wireless sensor

More information

COMPUTER NETWORKS Data link layer protocols

COMPUTER NETWORKS Data link layer protocols Data link layer (layer 2) Gruppo Reti TLC nome.cognome@polito.it http://www.telematica.polito.it/ Copyright Quest opera è protetta dalla licenza Creative Commons NoDerivs-NonCommercial. Per vedere una

More information

CS 421: Computer Networks SPRING MIDTERM I April 7, minutes

CS 421: Computer Networks SPRING MIDTERM I April 7, minutes CS 421: Computer Networks SPRING 24 MIDTERM I April 7, 24 12 minutes Name: Student No: 1) a) Consider a 1 Mbits/sec channel with a 1 msec one-way propagation delay. We want to transfer a file of size 8

More information

EE 122: Error detection and reliable transmission. Ion Stoica September 16, 2002

EE 122: Error detection and reliable transmission. Ion Stoica September 16, 2002 EE 22: Error detection and reliable transmission Ion Stoica September 6, 2002 High Level View Goal: transmit correct information Problem: bits can get corrupted - Electrical interference, thermal noise

More information

Politecnico di Milano Scuola di Ingegneria Industriale e dell Informazione. Link Layer. Fundamentals of Communication Networks

Politecnico di Milano Scuola di Ingegneria Industriale e dell Informazione. Link Layer. Fundamentals of Communication Networks Politecnico di Milano Scuola di Ingegneria Industriale e dell Informazione Link Layer Fundamentals of Communication Networks Data Link layer o It is the first logical layer in the protocol stack o Functions

More information

Error Detection Codes. Error Detection. Two Dimensional Parity. Internet Checksum Algorithm. Cyclic Redundancy Check.

Error Detection Codes. Error Detection. Two Dimensional Parity. Internet Checksum Algorithm. Cyclic Redundancy Check. Error Detection Two types Error Detection Codes (e.g. CRC, Parity, Checksums) Error Correction Codes (e.g. Hamming, Reed Solomon) Basic Idea Add redundant information to determine if errors have been introduced

More information

OMNet++ Tutorial. Chang-Gun Lee Assistant Professor The School of Computer Science and Engineering Seoul National University

OMNet++ Tutorial. Chang-Gun Lee Assistant Professor The School of Computer Science and Engineering Seoul National University OMNet++ Tutorial Chang-Gun Lee (cglee@snu.ac.kr) Assistant Professor The School of Computer Science and Engineering Seoul National University Why OMNet++ SMPL is not modular and so not extendable We need

More information

Network Management & Monitoring Network Delay

Network Management & Monitoring Network Delay Network Management & Monitoring Network Delay These materials are licensed under the Creative Commons Attribution-Noncommercial 3.0 Unported license (http://creativecommons.org/licenses/by-nc/3.0/) End-to-end

More information

CS 216 Exam 1 Fall SOLUTION

CS 216 Exam 1 Fall SOLUTION CS 216 Exam 1 Fall 2004 - SOLUTION Name: Lab Section: Email Address: Student ID # This exam is closed note, closed book. You will have an hour and fifty minutes total to complete the exam. You may NOT

More information

Lab 1 - Reliable Data Transport Protocol

Lab 1 - Reliable Data Transport Protocol Lab 1 - Reliable Data Transport Protocol Handout: March 8, 2018 Deadline: March 18 23:00, 2018 (No extension) Assignment overview: In this assignment, you will be implementing the sending and receiving

More information

On A Recursive Algorithm for SYN Flood Attacks

On A Recursive Algorithm for SYN Flood Attacks On A Recursive Algorithm for SYN Flood Attacks Pranay Meshram 1, Ravindra Jogekar 2, Pratibha Bhaisare 3 123 Department of Computer Science and Engineering 12 Priyadarshini J L College of Engineering,

More information

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

file:///c:/users/hpguo/dropbox/website/teaching/fall 2017/CS4470/H... 1 of 9 11/26/2017, 11:28 AM Homework 3 solutions 1. A window holds bytes 2001 to 5000. The next byte to be sent is 3001. Draw a figure to show the situation of the window after the following two events:

More information

802.11e Service Differentiation

802.11e Service Differentiation Nomadic Communications 802.11e Service Differentiation Renato Lo Cigno LoCigno@disi.unitn.it - Tel: 2026 Dipartimento di Ingegneria e Scienza dell Informazione Home Page: http://isi.unitn.it/locigno/index.php/teaching-duties/nomadic-communications

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

To make the examples easier to follow, all source code in here is cross-linked to the OMNeT++ API documentation.

To make the examples easier to follow, all source code in here is cross-linked to the OMNeT++ API documentation. Tic-Toc Tutorial Contents TicToc Tutorial for OMNeT++ This short tutorial to OMNeT++ guides you through an example of modeling and simulation, showing you along the way some of the commonly used OMNeT++

More information

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission 1 Lecture 4: CRC & Reliable Transmission CSE 123: Computer Networks Chris Kanich Quiz 1: Tuesday July 5th Lecture 4: CRC & Reliable Transmission Lecture 4 Overview CRC toward a better EDC Reliable Transmission

More information

802.11e Service Differentiation. Copyright. Quality-of-Service Provisioning: Some Terminology. Nomadic Communications

802.11e Service Differentiation. Copyright. Quality-of-Service Provisioning: Some Terminology. Nomadic Communications Nomadic Communications 802.11e Service Differentiation Renato Lo Cigno LoCigno@disi.unitn.it - Tel: 2026 Dipartimento di Ingegneria e Scienza dell Informazione Home Page: http://isi.unitn.it/locigno/index.php/teaching-duties/nomadic-communications

More information

Lecture 7: Flow & Media Access Control"

Lecture 7: Flow & Media Access Control Lecture 7: Flow & Media Access Control" CSE 123: Computer Networks Alex C. Snoeren HW 2 due next Wednesday! Lecture 7 Overview" Flow control Go-back-N Sliding window Methods to share physical media: multiple

More information

The Transport Layer Reliability

The Transport Layer Reliability The Transport Layer Reliability CS 3, Lecture 7 http://www.cs.rutgers.edu/~sn4/3-s9 Srinivas Narayana (slides heavily adapted from text authors material) Quick recap: Transport Provide logical communication

More information

Class definition. complete definition. public public class abstract no instance can be created final class cannot be extended

Class definition. complete definition. public public class abstract no instance can be created final class cannot be extended JAVA Classes Class definition complete definition [public] [abstract] [final] class Name [extends Parent] [impelements ListOfInterfaces] {... // class body public public class abstract no instance can

More information

CSE 473 Introduction to Computer Networks. Exam 1. Your name: 9/26/2013

CSE 473 Introduction to Computer Networks. Exam 1. Your name: 9/26/2013 CSE 473 Introduction to Computer Networks Jon Turner Exam 1 Your name: 9/26/2013 1. (10 points). A user in Chicago, connected to the internet via a 100 Mb/s (b=bits) connection retrieves a 250 KB (B=bytes)

More information

High Level View. EE 122: Error detection and reliable transmission. Overview. Error Detection

High Level View. EE 122: Error detection and reliable transmission. Overview. Error Detection High Level View EE 22: Error detection and reliable transmission Ion Stoica September 6, 22 Goal: transmit correct information Problem: bits can get corrupted - Electrical interference, thermal noise Solution

More information

A primer on modern LANs

A primer on modern LANs Advanced Networks http://disi.unitn.it/locigno/index.php/teaching-duties/ A primer on modern LANs Renato Lo Cigno Copyright Quest opera è prote1a dalla licenza: Crea&ve Commons A-ribuzione- Non commerciale-

More information

Network Management & Monitoring

Network Management & Monitoring Network Management & Monitoring Network Delay These materials are licensed under the Creative Commons Attribution-Noncommercial 3.0 Unported license (http://creativecommons.org/licenses/by-nc/3.0/) End-to-end

More information

Multimedia Networking and Quality of Service

Multimedia Networking and Quality of Service Multimedia Networking and Quality of Service Mario Baldi Politecnico di Torino (Technical Univeristy of Torino) Department of Computer Engineering mario.baldi [at] polito.it +39 011 564 7067 staff.polito.it/mario.baldi

More information

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor. 3.Constructors and Destructors Develop cpp program to implement constructor and destructor. Constructors A constructor is a special member function whose task is to initialize the objects of its class.

More information

Protocol Specification. Using Finite State Machines

Protocol Specification. Using Finite State Machines Protocol Specification Using Finite State Machines Introduction Specification Phase of Protocol Design allows the designer to prepare an abstract model of the protocol for testing and analysis. Finite

More information

l Determine if a number is odd or even l Determine if a number/character is in a range - 1 to 10 (inclusive) - between a and z (inclusive)

l Determine if a number is odd or even l Determine if a number/character is in a range - 1 to 10 (inclusive) - between a and z (inclusive) Final Exam Exercises Chapters 1-7 + 11 Write C++ code to: l Determine if a number is odd or even CS 2308 Fall 2016 Jill Seaman l Determine if a number/character is in a range - 1 to 10 (inclusive) - between

More information

Principles of Reliable Data Transfer

Principles of Reliable Data Transfer Principles of Reliable Data Transfer 1 Reliable Delivery Making sure that the packets sent by the sender are correctly and reliably received by the receiver amid network errors, i.e., corrupted/lost packets

More information

1999, Scott F. Midkiff

1999, Scott F. Midkiff Lecture Topics Direct Link Networks: Multiaccess Protocols (.7) Multiaccess control IEEE 80.5 Token Ring and FDDI CS/ECpE 556: Computer Networks Originally by Scott F. Midkiff (ECpE) Modified by Marc Abrams

More information

CMPE150 Midterm Solutions

CMPE150 Midterm Solutions CMPE150 Midterm Solutions Question 1 Packet switching and circuit switching: (a) Is the Internet a packet switching or circuit switching network? Justify your answer. The Internet is a packet switching

More information

TCP/IP Protocol Suite 1

TCP/IP Protocol Suite 1 TCP/IP Protocol Suite 1 Stream Control Transmission Protocol (SCTP) TCP/IP Protocol Suite 2 OBJECTIVES: To introduce SCTP as a new transport-layer protocol. To discuss SCTP services and compare them with

More information

An Architecture for Underwater Networks

An Architecture for Underwater Networks An Architecture for Underwater Networks Mandar Chitre Acoustic Research Laboratory, National University of Singapore Lee Freitag Woods Hole Oceanographic Institution Ethem Sozer Massachusetts Institute

More information

6.033 Computer System Engineering

6.033 Computer System Engineering MIT OpenCourseWare http://ocw.mit.edu 6.033 Computer System Engineering Spring 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 6.033 Lecture 13 Sam

More information

The Analysis And Implementation Of OMNeT++ Framework. By K. Sivakumar, G. Dalin

The Analysis And Implementation Of OMNeT++ Framework. By K. Sivakumar, G. Dalin Global Journal of Computer Science & Technology Volume 11 Issue 6 Version 1.0 April 2011 Type: Double Blind Peer Reviewed International Research Journal Publisher: Global Journals Inc. (USA) Online ISSN:

More information

Chapter 11 Data Link Control 11.1

Chapter 11 Data Link Control 11.1 Chapter 11 Data Link Control 11.1 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 11-1 FRAMING The data link layer needs to pack bits into frames, so that each

More information

Multi Hop Send Protocol Tool for TinyNodes Semesterthesis

Multi Hop Send Protocol Tool for TinyNodes Semesterthesis Multi Hop Send Protocol Tool for TinyNodes Semesterthesis Author: Supervisor: Tutor: Remo Niedermann Prof. Dr. Roger Wattenhofer Roland Flury Zurich, February 19, 2009 Acknowledgment At first I want to

More information

Cooperative Multitasking

Cooperative Multitasking Cooperative Multitasking Cooperative Multitasking let's make the controller for the lamp in an LCD projector Lamp off Fan off evbutton Lamp on Fan on evtimeout Lamp off Fan on evbutton Code for LCD Projector

More information

class Polynomial { public: Polynomial(const string& N = "no name", const vector<int>& C = vector<int>());... };

class Polynomial { public: Polynomial(const string& N = no name, const vector<int>& C = vector<int>());... }; Default Arguments 1 When declaring a C++ function, you may optionally specify a default value for function parameters by listing initializations for them in the declaration: class Polynomial { public:

More information

Programming Assignment 2

Programming Assignment 2 CS 122 Fall, 2004 Programming Assignment 2 New Mexico Tech Department of Computer Science Programming Assignment 2 CS122 Algorithms and Data Structures Due 11:00AM, Wednesday, October 13th, 2004 Objectives:

More information

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid CSCE 20/220 Data Structures and Algorithms Prof. Amr Goneid Fall 208 / Spring 209 CSCE 20/220 DATA STRUCTURES AND ALGORITHMS Prof. Amr Goneid Instructor: Prof. Amr Goneid E-mail: goneid@aucegypt.edu Office:

More information

High Level View. EE 122: Ethernet and Random Access protocols. Medium Access Protocols

High Level View. EE 122: Ethernet and Random Access protocols. Medium Access Protocols High Level View EE 122: Ethernet and 802.11 Ion Stoica September 18, 2002 Goal: share a communication medium among multiple hosts connected to it Problem: arbitrate between connected hosts Solution goals:

More information

Fundamentals of Queueing Models

Fundamentals of Queueing Models Fundamentals of Queueing Models Michela Meo Maurizio M. Munafò Michela.Meo@polito.it Maurizio.Munafo@polito.it TLC Network Group - Politecnico di Torino 1 Modeling a TLC network Modelization and simulation

More information

Two approaches to Flow Control. Cranking up to speed. Sliding windows in action

Two approaches to Flow Control. Cranking up to speed. Sliding windows in action CS314-27 TCP: Transmission Control Protocol IP is an unreliable datagram protocol congestion or transmission errors cause lost packets multiple routes may lead to out-of-order delivery If senders send

More information

Cpt S 122 Data Structures. Course Review FINAL. Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University

Cpt S 122 Data Structures. Course Review FINAL. Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 Data Structures Course Review FINAL Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Final When: Wednesday (12/12) 1:00 pm -3:00 pm Where: In Class

More information

Flow control: Ensuring the source sending frames does not overflow the receiver

Flow control: Ensuring the source sending frames does not overflow the receiver Layer 2 Technologies Layer 2: final level of encapsulation of data before transmission over a physical link responsible for reliable transfer of frames between hosts, hop by hop, i.e. on a per link basis

More information

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid. Fall 2018

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid. Fall 2018 CSCE 20/220 Data Structures and Algorithms Prof. Amr Goneid Fall 208 CSCE 20/220 DATA STRUCTURES AND ALGORITHMS Dr. Amr Goneid Course Goals To introduce concepts of Data Models, Data Abstraction and ADTs

More information

Networking, Java threads and synchronization. PRIS lecture 4 Fredrik Kilander

Networking, Java threads and synchronization. PRIS lecture 4 Fredrik Kilander Networking, Java threads and synchronization PRIS lecture 4 Fredrik Kilander OSI Application Presentation Session Transport Network Data link Physical TCP/IP Application Transport Internet Host-to-network

More information

CSE 473 Introduction to Computer Networks. Final Exam. Your name here: 12/17/2012

CSE 473 Introduction to Computer Networks. Final Exam. Your name here: 12/17/2012 CSE 473 Introduction to Computer Networks Jon Turner Final Exam Your name here: 12/17/2012 1. (8 points). The figure below shows a network path connecting a server to a client. 200 km 2000 km 2 km X Y

More information

SpiNNaker Application Programming Interface (API)

SpiNNaker Application Programming Interface (API) SpiNNaker Application Programming Interface (API) Version 2.0.0 10 March 2016 Application programming interface (API) Event-driven programming model The SpiNNaker API programming model is a simple, event-driven

More information

NWEN 243. Networked Applications. Layer 4 TCP and UDP

NWEN 243. Networked Applications. Layer 4 TCP and UDP NWEN 243 Networked Applications Layer 4 TCP and UDP 1 About the second lecturer Aaron Chen Office: AM405 Phone: 463 5114 Email: aaron.chen@ecs.vuw.ac.nz Transport layer and application layer protocols

More information

UNIT IV -- TRANSPORT LAYER

UNIT IV -- TRANSPORT LAYER UNIT IV -- TRANSPORT LAYER TABLE OF CONTENTS 4.1. Transport layer. 02 4.2. Reliable delivery service. 03 4.3. Congestion control. 05 4.4. Connection establishment.. 07 4.5. Flow control 09 4.6. Transmission

More information

Dos-A Scalable Optical Switch for Datacenters

Dos-A Scalable Optical Switch for Datacenters Dos-A Scalable Optical Switch for Datacenters Speaker: Lin Wang Research Advisor: Biswanath Mukherjee Ye, X. et al., DOS: A scalable optical switch for datacenters, Proceedings of the 6th ACM/IEEE Symposium

More information

CSCI 200 Lab 11 A Heap-Based Priority Queue

CSCI 200 Lab 11 A Heap-Based Priority Queue CSCI 200 Lab 11 A Heap-Based Priority Queue Preliminaries Part of today s lab will focus on implementing a heap-based priority queue using an ArrayListlike class called ZHExtensibleArrayStructure. Recall

More information

Basic Reliable Transport Protocols

Basic Reliable Transport Protocols Basic Reliable Transport Protocols Do not be alarmed by the length of this guide. There are a lot of pictures. You ve seen in lecture that most of the networks we re dealing with are best-effort : they

More information

Medium Access Control. IEEE , Token Rings. CSMA/CD in WLANs? Ethernet MAC Algorithm. MACA Solution for Hidden Terminal Problem

Medium Access Control. IEEE , Token Rings. CSMA/CD in WLANs? Ethernet MAC Algorithm. MACA Solution for Hidden Terminal Problem Medium Access Control IEEE 802.11, Token Rings Wireless channel is a shared medium Need access control mechanism to avoid interference Why not CSMA/CD? 9/15/06 CS/ECE 438 - UIUC, Fall 2006 1 9/15/06 CS/ECE

More information

EE 122: Ethernet and

EE 122: Ethernet and EE 122: Ethernet and 802.11 Ion Stoica September 18, 2002 (* this talk is based in part on the on-line slides of J. Kurose & K. Rose) High Level View Goal: share a communication medium among multiple hosts

More information

CSCD 330 Network Programming

CSCD 330 Network Programming CSCD 330 Network Programming Lecture 10 Transport Layer Continued Spring 2018 Reading: Chapter 3 Some Material in these slides from J.F Kurose and K.W. Ross All material copyright 1996-2007 1 Last Time.

More information

Chapter 4: network layer. Network service model. Two key network-layer functions. Network layer. Input port functions. Router architecture overview

Chapter 4: network layer. Network service model. Two key network-layer functions. Network layer. Input port functions. Router architecture overview Chapter 4: chapter goals: understand principles behind services service models forwarding versus routing how a router works generalized forwarding instantiation, implementation in the Internet 4- Network

More information

Nomadic Communications WLAN MAC Fundamentals

Nomadic Communications WLAN MAC Fundamentals Nomadic Communications WLAN 802.11 MAC Fundamentals Renato Lo Cigno ANS Group locigno@disi.unitn.it http://disi.unitn.it/locigno/index.php/teaching-duties/nomadic-communications Copyright Quest opera è

More information

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR STUDENT IDENTIFICATION NO MULTIMEDIA COLLEGE JALAN GURNEY KIRI 54100 KUALA LUMPUR FIFTH SEMESTER FINAL EXAMINATION, 2014/2015 SESSION PSD2023 ALGORITHM & DATA STRUCTURE DSEW-E-F-2/13 25 MAY 2015 9.00 AM

More information

MAC. Fall Data Communications II 1

MAC. Fall Data Communications II 1 802.11 MAC Fall 2005 91.564 Data Communications II 1 RF Quality (ACK) Fall 2005 91.564 Data Communications II 2 Hidden Terminal (RTS/CTS) Fall 2005 91.564 Data Communications II 3 MAC Coordination Functions

More information

Direct Link Networks (II)

Direct Link Networks (II) Direct Link Networks (II) Computer Networking Lecture 03 HKU SPACE Community College January 30, 2012 HKU SPACE CC CN Lecture 03 1/25 Outline Reliable Link Service Stop-and-Wait Sliding Window Media Access

More information

Appendix A Pseudocode of the wlan_mac Process Model in OPNET

Appendix A Pseudocode of the wlan_mac Process Model in OPNET Appendix A Pseudocode of the wlan_mac Process Model in OPNET static void wlan_frame_transmit () { char msg_string [120]; char msg_string1 [120]; WlanT_Hld_List_Elem* hld_ptr; const WlanT_Data_Header_Fields*

More information

16.682: Communication Systems Engineering. Lecture 17. ARQ Protocols

16.682: Communication Systems Engineering. Lecture 17. ARQ Protocols 16.682: Communication Systems Engineering Lecture 17 ARQ Protocols Eytan Modiano Automatic repeat request (ARQ) Break large files into packets FILE PKT H PKT H PKT H Check received packets for errors Use

More information

CS447-Network and Data Communication Project #2 Specification, Fall 2017 Due December 5, 2017

CS447-Network and Data Communication Project #2 Specification, Fall 2017 Due December 5, 2017 CS447-Network and Data Communication Project #2 Specification, Fall 2017 Due December 5, 2017 1. Introduction In this project, we will develop a Sliding-Window flow-control (SWFC) simulator using C/C++

More information

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive)

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive) Final Exam Exercises Chapters 1-7 + 11 Write C++ code to:! Determine if a number is odd or even CS 2308 Fall 2018 Jill Seaman! Determine if a number/character is in a range - 1 to 10 (inclusive) - between

More information

LS Example 5 3 C 5 A 1 D

LS Example 5 3 C 5 A 1 D Lecture 10 LS Example 5 2 B 3 C 5 1 A 1 D 2 3 1 1 E 2 F G Itrn M B Path C Path D Path E Path F Path G Path 1 {A} 2 A-B 5 A-C 1 A-D Inf. Inf. 1 A-G 2 {A,D} 2 A-B 4 A-D-C 1 A-D 2 A-D-E Inf. 1 A-G 3 {A,D,G}

More information

CE693: Adv. Computer Networking

CE693: Adv. Computer Networking CE693: Adv. Computer Networking L-10 Wireless Broadcast Fall 1390 Acknowledgments: Lecture slides are from the graduate level Computer Networks course thought by Srinivasan Seshan at CMU. When slides are

More information

Part I: Short Answer (12 questions, 65 points total)

Part I: Short Answer (12 questions, 65 points total) CSE 143 Sp01 Final Exam Sample Solution page 1 of 14 Part I: Short Answer (12 questions, 65 points total) Answer all of the following questions. READ EACH QUESTION CAREFULLY. Answer each question in the

More information