Sockets class notes

IN CLASS PRESENTATIONS

    1. Debookee – a similar program to wireshark
    2. First 3 digits of MAC addresses represent the manufacture of the hardware
    3. m -search
    4. The router ip address shows activity that related only to its application (maintenance stuff such as ARP = Address Resolution Protocol. Devices speaking to routers), and won’t show ALL the activity going through it
    5. Incognito mode is only blocking cookies, cache and history record of the browser. The actual traffic could be seen to anyone connected to that router.
    6. A lot of times cybercrime is not about hiding or not showing where its coming from but about how fast it happens. The way to be absolutely hidden is using sneakernets (physically moving removable media such as usb drive).
    7. callback = a function that calls a function. A function that takes as an argument another function.
    8. require(‘net’) =  is a library

NODE

Node is a way to use javaScript outside of the browser context. Using the command line you can access files on the computer, listen to network traffic, handle http requests (build a server), access databases directly etc (things that one would use – ruby on rails, php, python etc)

SOCKETS

Ports, sockets and connections, how does it all fit together? TCP socket vs network socket:

Every socket consists of three things:

  1. An IP address
  2. A transport protocol (e.g. TCP, UDP)
  3. A port number (e.g. 80, 8080)

A port is a number between 1 and 65535 inclusive that signifies a logical gate in a device. Each application running on the client will have a different port number.

Every connection between a client and server requires a unique socket.
For example:

  • 1030 is a port.
  • (10.1.1.2 , TCP , port 1030) is a socket.

Note: The term port also refers to several other aspects of network technology. A port can refer to a physical connection point for peripheral devices such as serial, parallel, and USB ports. The term port also refers to certain Ethernet connection points, such as those on a hub, switch, or router.

MICRO CONTROLLERS

  • Uno
  • Yun
  • Pi
  • Beagleboard
  • Wifi micro controllers:
    • ESP 8266
    • Photon

Overall Diagram undNet

socket Diagram

REAL TIME

When trying to send data from the real word to a server the information needs to go through a lot of steps. Each steps can potentially slow the information, increasing the difference between the action of the user and the feedback from the server. Microcontroller time, Os Time, and network time all adds up to this difference. A way to make the process faster is by doing hardware interrupts.

Hardware interrupts are the same as events in JS (mousePress keyDown etc) gives a signal when something changes. In systems programming, an interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing.

USFUL LINKS

To use ESPA266 micro wifi model: https://github.com/tigoe/ESP8266Examples

To use arduino (uno/mega) with node:  https://github.com/tigoe/NodeExamples

To use with arduino shell: https://github.com/tigoe/NetworkExamples/tree/master/BallDropClient

To use with Yun: https://github.com/tigoe/BridgeExamples/tree/master/BridgeTCPSocket

Read “Node” e-book in safari NYU for free online:

  • login to http://home.nyu.edu
  • click on the tab labeled “Research”
  • in the section of the page labeled “NYU Libraries”, find the section with the header “DATABASES A-Z” and click on “S” (for Safari)
  • a new page will open up in your browser listing all the databases starting with the letter S
  • find in that list the link for “Safari Books Online” and click on it
  • your browser will be directed to a Safari page that provides access to hundreds of titles from O’Reilly and related publishers

Leave a Comment

Required fields are marked *.