code: def add_nio(self, nio, port_number):
          
  
          if port_number not in [port["port_number"] for port in self._ports]:
              raise DynamipsError("Port {} doesn't exist".format(port_number))
  
          if port_number in self._mappings:
              raise DynamipsError("Port {} isn't free".format(port_number))
  
          yield from Bridge.add_nio(self, nio)
  
          log.info('Ethernet hub "{name}" [{id}]: NIO {nio} bound to port {port}'.format(name=self._name,
                                                                                         id=self._id,
                                                                                         nio=nio,
                                                                                         port=port_number))
          self._mappings[port_number] = nio
docs: Adds a NIO as new port on this hub.
  
          :param nio: NIO instance to add
          :param port_number: port to allocate for the NIO