comnet.technion.ac.il/~cn23s00 computer networks laborator y technion israel institute of technology...
TRANSCRIPT
![Page 1: Comnet.technion.ac.il/~cn23s00 Computer Networks Laborator y Technion Israel Institute of Technology BlueTooth High-Level Simulator A Base Platform For](https://reader036.vdocuments.us/reader036/viewer/2022072016/56649ee05503460f94bf1080/html5/thumbnails/1.jpg)
comnet.technion.ac.il/~cn23s00
Computer Networks Laborator
y
Technion Israel Institute of Technology
BlueTooth High-Level BlueTooth High-Level Simulator Simulator
A Base Platform For Simulating Packets A Base Platform For Simulating Packets Routing Algorithms Over A Bluetooth Routing Algorithms Over A Bluetooth ScatternetScatternet
Students: Ehud Klugman [email protected] Eitan Peri [email protected]
Instructor : Ran Cohen
![Page 2: Comnet.technion.ac.il/~cn23s00 Computer Networks Laborator y Technion Israel Institute of Technology BlueTooth High-Level Simulator A Base Platform For](https://reader036.vdocuments.us/reader036/viewer/2022072016/56649ee05503460f94bf1080/html5/thumbnails/2.jpg)
299-0767, ZLE Strategy summaryBlueTooth High Level
Simulator
BlueTooth BackgroundBlueTooth Background BlueTooth is a technology specification.BlueTooth is a technology specification. It describes how various electronic products, can It describes how various electronic products, can
interconnect with each other using a short-range interconnect with each other using a short-range wirelesswireless connection, and establish a network. connection, and establish a network.
Some BlueTooth basic terms:Some BlueTooth basic terms: UnitUnit - - The most primitive element in a BlueTooth scatternet. It can be The most primitive element in a BlueTooth scatternet. It can be
any electronic product which implements the BlueTooth specification.any electronic product which implements the BlueTooth specification. At a single piconet, a unit can be a master unit or a slave unit.At a single piconet, a unit can be a master unit or a slave unit.
PiconetPiconet - A “mini-network”, with small coverage area, which consist of - A “mini-network”, with small coverage area, which consist of oone ne BlueToothBlueTooth master unit, and master unit, and oone to seven slave units. ne to seven slave units. Slaves Slaves communicate only with the master unit (and not with each other).communicate only with the master unit (and not with each other).
A BlueTooth Scatternet
ScatternetScatternet - - Group of piconets with overlapping area of coverage. A unit Group of piconets with overlapping area of coverage. A unit can act as master & slave at the same time in different piconets or as slave can act as master & slave at the same time in different piconets or as slave in those piconets. It is possible to route packets in a scatternet.in those piconets. It is possible to route packets in a scatternet.
![Page 3: Comnet.technion.ac.il/~cn23s00 Computer Networks Laborator y Technion Israel Institute of Technology BlueTooth High-Level Simulator A Base Platform For](https://reader036.vdocuments.us/reader036/viewer/2022072016/56649ee05503460f94bf1080/html5/thumbnails/3.jpg)
399-0767, ZLE Strategy summaryBlueTooth High Level
Simulator
Project ObjectivesProject Objectives
Base platform for simulating routing algorithms over a Base platform for simulating routing algorithms over a scatternet.scatternet.
Simulates connecting/disconnecting of units to the Simulates connecting/disconnecting of units to the scatternet over the time axis.scatternet over the time axis.
The behavior of the unit is pre-defined by the user using The behavior of the unit is pre-defined by the user using different attributes.different attributes.
Supporting run-time tracing over unit’s connectivity to Supporting run-time tracing over unit’s connectivity to the scatternet.the scatternet.
User Interference during run-time, can be used to User Interference during run-time, can be used to connect/disconnect units form the piconet or the connect/disconnect units form the piconet or the scatternet.scatternet.
![Page 4: Comnet.technion.ac.il/~cn23s00 Computer Networks Laborator y Technion Israel Institute of Technology BlueTooth High-Level Simulator A Base Platform For](https://reader036.vdocuments.us/reader036/viewer/2022072016/56649ee05503460f94bf1080/html5/thumbnails/4.jpg)
499-0767, ZLE Strategy summaryBlueTooth High Level
Simulator
Our Implementation - GeneralOur Implementation - General Language: Language: JavaJava..
Code can run on any platform.Code can run on any platform. Ready classes for networking and threads.Ready classes for networking and threads.
Each unit is represented by a Each unit is represented by a separate processseparate process.. Our code implements a single unit, which can be executed from the Our code implements a single unit, which can be executed from the
command prompt.command prompt. Running a few units simultaneously, can create a piconet/ scatternet.Running a few units simultaneously, can create a piconet/ scatternet.
The units communicate over the network using The units communicate over the network using UDPUDP:: UDP is best for simulation radio transmissions.UDP is best for simulation radio transmissions. Units can run on different machines.Units can run on different machines. Packets loss is simulated in application level.Packets loss is simulated in application level.
Acknowledge is needed for every packet transmissionsAcknowledge is needed for every packet transmissions (except (except broadcast & SCO connection)broadcast & SCO connection), and is implemented in application , and is implemented in application level.level.
![Page 5: Comnet.technion.ac.il/~cn23s00 Computer Networks Laborator y Technion Israel Institute of Technology BlueTooth High-Level Simulator A Base Platform For](https://reader036.vdocuments.us/reader036/viewer/2022072016/56649ee05503460f94bf1080/html5/thumbnails/5.jpg)
599-0767, ZLE Strategy summaryBlueTooth High Level
Simulator
Packets enumerating is used to distinguish packets:Packets enumerating is used to distinguish packets: Avoiding duplicated packets/ack. to be executed more then once.Avoiding duplicated packets/ack. to be executed more then once. Use Use Responses CacheResponses Cache in order to save re-calculating a certain in order to save re-calculating a certain
response, when duplicating request is received.response, when duplicating request is received. Running the simulation can be done through script:Running the simulation can be done through script:
Scripts Contain some attributes for each unit, in a single line.Scripts Contain some attributes for each unit, in a single line. It executes the processes/units one by one.It executes the processes/units one by one.
Command-line user interface can be used to change/see units’ Command-line user interface can be used to change/see units’ attributes on run time:attributes on run time:
Changing the roles of a unit, means connecting disconnecting it from a Changing the roles of a unit, means connecting disconnecting it from a specific piconet, or destroying it completely.specific piconet, or destroying it completely.
Seeing the units connectivity, and other information.Seeing the units connectivity, and other information.
Our Implementation – General (cont.)Our Implementation – General (cont.)
Script Line Example:Btsim -master 2.3 7.5 132.68.55.1 2022 -if
Role of the unit
Role of the unit
Executable Name
Executable Name
Role’s start time
Role’s start time
IP address of this role
IP address of this role
Use user interface
Use user interface
Role’s end time
Role’s end time
Port number of this role
Port number of this role
![Page 6: Comnet.technion.ac.il/~cn23s00 Computer Networks Laborator y Technion Israel Institute of Technology BlueTooth High-Level Simulator A Base Platform For](https://reader036.vdocuments.us/reader036/viewer/2022072016/56649ee05503460f94bf1080/html5/thumbnails/6.jpg)
699-0767, ZLE Strategy summaryBlueTooth High Level
Simulator
High Level Design – Classes RelationsHigh Level Design – Classes Relations
BT_sendBT_requestsTable BT_msgSendQueue BT_recv
BT_udpConnection
BT_responseCache
BT_unitFuncManager
BT_unitFunc
1
N
Slave Master
InheritedBT_scheduler
BT_userInterface
![Page 7: Comnet.technion.ac.il/~cn23s00 Computer Networks Laborator y Technion Israel Institute of Technology BlueTooth High-Level Simulator A Base Platform For](https://reader036.vdocuments.us/reader036/viewer/2022072016/56649ee05503460f94bf1080/html5/thumbnails/7.jpg)
799-0767, ZLE Strategy summaryBlueTooth High Level
Simulator
High Level Design – Main Classes High Level Design – Main Classes DescriptionDescription
BTudpConnectionBTudpConnection - A single n - A single network connectionetwork connection.. BTrecvBTrecv - - Inherited from thread class, and handles received massages Inherited from thread class, and handles received massages
from the networkfrom the network. T. There are two kind of received massages:here are two kind of received massages: RequestRequest - Contain a certain command that should be handled by the - Contain a certain command that should be handled by the
receiving unit. For example, a request from new slave unit to the piconet’s receiving unit. For example, a request from new slave unit to the piconet’s master to be added to this piconetmaster to be added to this piconet..
Response Response – Contains the result of executing previous Request. – Contains the result of executing previous Request. There are There are two kinds of responses:two kinds of responses:
– Immediate responseImmediate response – Indicates that the request and was received, and – Indicates that the request and was received, and the receiving unit started to process it. It is sent when the processing the receiving unit started to process it. It is sent when the processing time of the request might be long.time of the request might be long.
– Final replayFinal replay – Indicates that the receiving unit finished processing the – Indicates that the receiving unit finished processing the request, and contains the requested data. As in the example above, the request, and contains the requested data. As in the example above, the master can replay to the new unit with its identification number in the master can replay to the new unit with its identification number in the piconet or by denying the request piconet or by denying the request
BTrequestsTableBTrequestsTable - - Implements a table, that contains requests that were Implements a table, that contains requests that were sent on the network, but no acknowledgements were received for them.sent on the network, but no acknowledgements were received for them.
![Page 8: Comnet.technion.ac.il/~cn23s00 Computer Networks Laborator y Technion Israel Institute of Technology BlueTooth High-Level Simulator A Base Platform For](https://reader036.vdocuments.us/reader036/viewer/2022072016/56649ee05503460f94bf1080/html5/thumbnails/8.jpg)
899-0767, ZLE Strategy summaryBlueTooth High Level
Simulator
High Level Design – Main Classes High Level Design – Main Classes Description (continue)Description (continue)
BTresponseCacheBTresponseCache - C - Caching implementation of the responses that the unit is aching implementation of the responses that the unit is sending to other units:sending to other units:
When a request from the unit is received at the first time:When a request from the unit is received at the first time:– It is passed to BTunitFuncManager that generates a response.It is passed to BTunitFuncManager that generates a response.– The response is stored in the data structure of this class.The response is stored in the data structure of this class.
If this request is received again (response was lost):If this request is received again (response was lost):– Its response is stored in the cache of receiving unit (BTrecv).Its response is stored in the cache of receiving unit (BTrecv).– The response is read from the cache, and is send immediately. The time of The response is read from the cache, and is send immediately. The time of
computing the response again is saved.computing the response again is saved. BTmsgSendQueueBTmsgSendQueue - - Implements a queue of massages that should to be sent:Implements a queue of massages that should to be sent:
BTrecv & BTunitFunc classes fill this queue with massages.BTrecv & BTunitFunc classes fill this queue with massages. BTsend’, which run on separate thread, fetches the massages that is located on the BTsend’, which run on separate thread, fetches the massages that is located on the
top of this queue, and send them.top of this queue, and send them. BTsendBTsend -Inherited from thread class, and has two tasks: -Inherited from thread class, and has two tasks:
Sends to network the massages that are in BTmsgSendQueue. Each sent massage is Sends to network the massages that are in BTmsgSendQueue. Each sent massage is also added to BTrequestsQueue.also added to BTrequestsQueue.
Re-send requests that weren’t acknowledged by the destination unit after a certain Re-send requests that weren’t acknowledged by the destination unit after a certain time (using BTrequestsQueue).time (using BTrequestsQueue).
![Page 9: Comnet.technion.ac.il/~cn23s00 Computer Networks Laborator y Technion Israel Institute of Technology BlueTooth High-Level Simulator A Base Platform For](https://reader036.vdocuments.us/reader036/viewer/2022072016/56649ee05503460f94bf1080/html5/thumbnails/9.jpg)
999-0767, ZLE Strategy summaryBlueTooth High Level
Simulator
High Level Design – Main Classes High Level Design – Main Classes Description (continue)Description (continue)
BTunitFuncBTunitFunc - Represents a single functionality of the unit in the Bluetooth - Represents a single functionality of the unit in the Bluetooth scatternet. scatternet.
Such a functionality is either master or a slave in Such a functionality is either master or a slave in a single piconeta single piconet.. A unit can own more than one BTunitFunc, if it is in a few piconets.A unit can own more than one BTunitFunc, if it is in a few piconets. Those two functionalities are inherited from this class. Those two functionalities are inherited from this class.
BTunitFuncManagerBTunitFuncManager - - Responsible for the following:Responsible for the following: Create a new BTunitFunc, or destroy an existing one.Create a new BTunitFunc, or destroy an existing one.
– Creation or destruction of BTunitFunc is done, when a command is passed to Creation or destruction of BTunitFunc is done, when a command is passed to this class from BTscheduler or BTuserInterface classes.this class from BTscheduler or BTuserInterface classes.
Receive massages from BTrecv and deliver them to the right BTunitFunctional Receive massages from BTrecv and deliver them to the right BTunitFunctional object. object.
BTuserInterfaceBTuserInterface - - Inherited from thread class, & has the following tasks:Inherited from thread class, & has the following tasks: Display unit’s information to the user on screen.Display unit’s information to the user on screen. Receive from the user some basic commands.Receive from the user some basic commands.
BTschedulerBTscheduler - It is the main stream of the unit, & has two main tasks: - It is the main stream of the unit, & has two main tasks: Create all other objects on proccess initialization.Create all other objects on proccess initialization. Schedule the creation and the destruction of BTunitFunc classes, by using Schedule the creation and the destruction of BTunitFunc classes, by using
functions of BTunitFuncManager functions of BTunitFuncManager