def is_local(connection):
    """
    Returns true if a connection is local.
    """
    return (connection.src.loc.x, connection.src.loc.y) == \
           (connection.dst.loc.x, connection.dst.loc.y)