Skip to content

Script's rules don't change class IDs. #100

Closed
@user-name-is-taken

Description

@user-name-is-taken

tcset must change the class IDs when using the --add parameter. When running tcset commands, this works:

USER@MACHINE ~/ $ tcshow eth5
{
    "eth5": {
        "outgoing": {},
        "incoming": {}
    }
}
USER@MACHINE ~/ $ sudo tcset --loss 4 --add --network 192.168.4.0/24 eth5
USER@MACHINE ~/ $ sudo tcset --loss 2 --add --network 192.168.2.0/24 eth5
USER@MACHINE ~/ $ tcshow eth5
{
    "eth5": {
        "outgoing": {
            "dst-network=192.168.4.0/24, protocol=ip": {
                "loss": 4,
                "rate": "32G",
                "filter_id": "800::800"
            },
            "dst-network=192.168.2.0/24, protocol=ip": {
                "loss": 2,
                "rate": "32G",
                "filter_id": "800::801"
            }
        },
        "incoming": {}
    }
}

As you can see above, tcshow shows that there are different rules for the % of dropped packets.


However, scripts generated with the --tc-script parameter don't do this:


 USER@MACHINE ~/ $ tcshow eth5
{
    "eth5": {
        "outgoing": {},
        "incoming": {}
    }
}
 USER@MACHINE ~/ $ sudo tcset --loss 2 --add --network 192.168.2.0/24 --tc-script eth5
[INFO] tcconfig: written a tc script to 'tcset_eth5.sh'
 USER@MACHINE ~/ $ mv tcset_eth5.sh tcset_2.sh
 USER@MACHINE ~/ $ sudo ./tcset_2.sh
 USER@MACHINE ~/ $ sudo tcset --loss 4 --add --network 192.168.4.0/24 --tc-script eth5
[INFO] tcconfig: written a tc script to 'tcset_eth5.sh'
 USER@MACHINE ~/ $ mv tcset_eth5.sh tcset_4.sh
 USER@MACHINE ~/ $ sudo ./tcset_4.sh 
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
 USER@MACHINE ~/ $ tcshow eth5
{
    "eth5": {
        "outgoing": {
            "dst-network=192.168.2.0/24, protocol=ip": {
                "filter_id": "800::800",
                "loss": 2,
                "rate": "32G"
            },
            "dst-network=192.168.4.0/24, protocol=ip": {
                "filter_id": "800::801",
                "loss": 2,
                "rate": "32G"
            }
        },
        "incoming": {}
    }
}

As you can see, both networks are set to a loss of 2% where 192.168.2.0/24 should be 2% and 192.168.4.0/24 should be 4%.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions