Scout Module API

Reserving Ports

Reserving Ports

Ports can be reserved by writing to file /proc/scout/ports/reserve. Only the Node Manager (i.e., root) can write to this file. Run 'cat' on this file to see the port reservation syntax:


  [princeton8@planetlab-3] cat /proc/scout/ports/reserve 
  Write to this file to reserve a port
  Format: [vserver id] u|t|i [port #]
    For the second argument, u = udp, t = tcp, i = icmp
  Example: 758 t 12345

A reserved port is owned by the slice, and only this slice can open sockets on that port bound to any IP address. The reservation takes place immediately upon writing to /proc/scout/ports/reserve. If a port is already owned by a slice for any IP address, and an attempt is made to reserve the port for another slice, it will have no effect.

A port reservation remains in effect until it is explicitly released. To remove a reservation, the Node Manager writes the same string used to reserve the port to /proc/scout/ports/release.