Restriction enzymes function as a means of protection against phage DNA. These enzymes recognize and cut specific sequences on the phage DNA, thereby preventing the survival of foreign DNA in the cell. Restriction sites in bacterial chromosomal DNA are protected from its own restriction enzymes by methylation of nucleotides in the target sites or recognition sites.