Binary representation, Logical and function – Netopia R5300 User Manual

Page 211

Advertising
background image

Security 13-33

and a packet goes through these rules destined for FTP, the packet would for ward through the first rule (WWW),
go through the second rule (FTP), and match this rule; the packet is allowed through.

If you had this filter set for example....

Allow WWW access;

Allow FTP access;

Deny FTP access;

Deny all other packets.

and a packet goes through these rules destined for FTP, the packet would for ward through the first filter rule
(WWW), match the second rule (FTP), and the packet is allowed through. Even though the next rule is to deny all
FTP traffic, the FTP packet will never make it to this rule.

B

B

B

Biiiin

n

n

naa

a

arrrryyy

y rrrree

e

ep

p

p

prrrree

e

essssee

e

en

n

n

nttttaa

a

attttiiiio

o

o

on

n

n

n

It is easiest when doing filtering to conver t the IP address and mask in question to binar y. This will allow you to
per form the logical AND to determine whether a packet matches a filter rule.

LLL

Lo

o

o

og

g

g

giiiiccccaa

a

allll A

A

A

AN

N

N

ND

D

D

D ffffu

u

u

un

n

n

nccccttttiiiio

o

o

on

n

n

n

When a packet is compared (in most cases) a logical AND function is per formed. First the IP addresses and
subnet masks are conver ted to binar y and then combined with AND. The rules for the logical use of AND are as
follows:

0 AND 0 = 0

0 AND 1 = 0

1 AND 0 = 0

1 AND 1 = 1

For example:

Filter rule:

Deny

IP: 163.176.1.15BINARY:

10100011.10110000.00000001.00001111

Mask: 255.255.255.255BINARY:11111111.11111111.11111111.11111111

Incoming Packet:

IP 163.176.1.15BINARY:

10100011.10110000.00000001.00001111

If you put the incoming packet and subnet mask together with AND, the result is:

10100011.10110000.00000001.00001111

which matches the IP address in the filter rule and the packet is denied.

Advertising
This manual is related to the following products: